From 9e90a400a576da61e7a75d5cf1159e478a68ef04 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Sun, 12 Sep 2021 06:19:25 +0200 Subject: [PATCH] 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: ' Fixes #137390 --- lib/generators.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/generators.nix b/lib/generators.nix index bcb0f371a9b5..e1c7e8737d73 100644 --- a/lib/generators.nix +++ b/lib/generators.nix @@ -169,7 +169,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;