fork/home-manager

git clone https://git.julia.blue/fork/home-manager

h7x4lib: add generator for KDLfce9dbfe

master
965 B53 linesraw
1{ config, lib, ... }:
2
3{
4  home.file."result.txt".text = lib.hm.generators.toKDL { } {
5    a = 1;
6    b = "string";
7    c = ''
8      multiline string
9      with special characters:
10      \t \n \" "
11    '';
12    unsafeString = " \" \n 	 ";
13    flatItems = [ 1 2 "asdf" true null ];
14    bigFlatItems = [
15      23847590283751
16      1.239
17      ''
18        multiline " " "
19        string
20      ''
21      null
22    ];
23    nested = [ [ 1 2 ] [ true false ] [ ] [ null ] ];
24    extraAttrs = {
25      _args = [ 2 true ];
26      _props = {
27        arg1 = 1;
28        arg2 = false;
29      };
30      nested = {
31        a = 1;
32        b = null;
33      };
34    };
35    listInAttrsInList = {
36      list1 = [
37        { a = 1; }
38        { b = true; }
39        {
40          c = null;
41          d = [{ e = "asdfadfasdfasdf"; }];
42        }
43      ];
44      list2 = [{ a = 8; }];
45    };
46  };
47
48  nmt.script = ''
49    assertFileContent \
50      home-files/result.txt \
51      ${./tokdl-result.txt}
52  '';
53}