lib.generators.toGitINI: don't traverse derivations
Consider a derivation a value to be serialized. nix-repl> lib.generators.toGitINI { hello = { drv = pkgs.hello; }; } error: evaluation aborted with the following error message: 'generators.mkValueStringDefault: attrsets not supported: <derivation /nix/store/533q15q67sl6dl0272dyi7m7w5pwkkjh-hello-2.10.drv>' Fixes #137390
This commit is contained in:
parent
fc4247e827
commit
9e90a400a5
@ -169,7 +169,7 @@ rec {
|
|||||||
# converts { a.b.c = 5; } to { "a.b".c = 5; } for toINI
|
# converts { a.b.c = 5; } to { "a.b".c = 5; } for toINI
|
||||||
gitFlattenAttrs = let
|
gitFlattenAttrs = let
|
||||||
recurse = path: value:
|
recurse = path: value:
|
||||||
if isAttrs value then
|
if isAttrs value && !lib.isDerivation value then
|
||||||
lib.mapAttrsToList (name: value: recurse ([ name ] ++ path) value) value
|
lib.mapAttrsToList (name: value: recurse ([ name ] ++ path) value) value
|
||||||
else if length path > 1 then {
|
else if length path > 1 then {
|
||||||
${concatStringsSep "." (lib.reverseList (tail path))}.${head path} = value;
|
${concatStringsSep "." (lib.reverseList (tail path))}.${head path} = value;
|
||||||
|
Loading…
Reference in New Issue
Block a user