pkgs-lib: allow paths in TOML, YAML and JSON

Paths get automatically added to the store. The INI generator currently chokes
on paths, so it is not supported for now.
This commit is contained in:
Ben Wolsieffer 2020-11-15 11:54:15 -05:00
parent 2db14a9cb5
commit 98336c223b
2 changed files with 6 additions and 0 deletions

View file

@ -30,6 +30,7 @@ rec {
int int
float float
str str
path
(attrsOf valueType) (attrsOf valueType)
(listOf valueType) (listOf valueType)
]) // { ]) // {
@ -112,6 +113,7 @@ rec {
int int
float float
str str
path
(attrsOf valueType) (attrsOf valueType)
(listOf valueType) (listOf valueType)
] // { ] // {

View file

@ -38,6 +38,7 @@ in runBuildTests {
str = "foo"; str = "foo";
attrs.foo = null; attrs.foo = null;
list = [ null null ]; list = [ null null ];
path = ./formats.nix;
}; };
expected = '' expected = ''
{ {
@ -52,6 +53,7 @@ in runBuildTests {
null null
], ],
"null": null, "null": null,
"path": "${./formats.nix}",
"str": "foo", "str": "foo",
"true": true "true": true
} }
@ -67,6 +69,7 @@ in runBuildTests {
str = "foo"; str = "foo";
attrs.foo = null; attrs.foo = null;
list = [ null null ]; list = [ null null ];
path = ./formats.nix;
}; };
expected = '' expected = ''
{ {
@ -80,6 +83,7 @@ in runBuildTests {
null null
], ],
"null": null, "null": null,
"path": "${./formats.nix}",
"str": "foo", "str": "foo",
"true": true "true": true
} }