diff options
Diffstat (limited to 'nixpkgs/lib/generators.nix')
-rw-r--r-- | nixpkgs/lib/generators.nix | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nixpkgs/lib/generators.nix b/nixpkgs/lib/generators.nix index bcb0f371a9b5..0cec4d2dd620 100644 --- a/nixpkgs/lib/generators.nix +++ b/nixpkgs/lib/generators.nix @@ -35,6 +35,8 @@ rec { ("generators.mkValueStringDefault: " + "${t} not supported: ${toPretty {} v}"); in if isInt v then toString v + # convert derivations to store paths + else if lib.isDerivation v then toString v # we default to not quoting strings else if isString v then v # isString returns "1", which is not a good default @@ -169,7 +171,7 @@ rec { # converts { a.b.c = 5; } to { "a.b".c = 5; } for toINI gitFlattenAttrs = let recurse = path: value: - if isAttrs value then + if isAttrs value && !lib.isDerivation value then lib.mapAttrsToList (name: value: recurse ([ name ] ++ path) value) value else if length path > 1 then { ${concatStringsSep "." (lib.reverseList (tail path))}.${head path} = value; |