1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-04 17:09:47 +01:00
home-manager/tests/lib/generators/tokdl.nix

131 lines
2.4 KiB
Nix
Raw Normal View History

{ lib, ... }: {
home.file."tokdl-result.txt".text = lib.hm.generators.toKDL { } [
{
name = "a";
args = 1;
}
{
name = "b";
args = "string";
}
{
name = "c";
args = ''
multiline string
with special characters:
\t \n \" "
'';
}
{
name = "unsafeString";
args = " \" \n ";
}
{
name = "flatItems";
args = [ 1 2 "asdf" true null ];
}
{
name = "bigFlatItems";
args = [
23847590283751
1.239
''
multiline " " "
string
''
null
];
}
{
name = "repeated";
args = [ 1 2 ];
}
{
name = "repeated";
args = [ true false ];
}
{ name = "repeated"; }
{
name = "repeated";
args = [ null ];
}
{
name = "extraAttrs";
args = [ 2 true ];
props = {
arg1 = 1;
arg2 = false;
};
children = {
name = "nested";
children = [
{
name = "a";
args = [ 1 ];
}
{
name = "b";
args = [ null ];
}
];
};
}
{
name = "listInAttrsInList";
children = [
{
name = "list1";
children = [
{
name = "-";
children = {
name = "a";
args = [ 1 ];
};
}
{
name = "-";
children = {
name = "b";
args = [ true ];
};
}
{
name = "-";
children = [
{
name = "c";
args = [ null ];
}
{
name = "d";
children = {
name = "-";
children = {
name = "e";
args = [ "asdfadfasdfasdf" ];
};
};
}
];
}
];
}
{
name = "list2";
children = [{
name = "a";
args = [ 8 ];
}];
}
];
}
];
nmt.script = ''
assertFileContent \
2023-11-11 10:19:45 +01:00
home-files/tokdl-result.txt \
${./tokdl-result.txt}
'';
}