diff options
| author | Timothy DeHerrera <tim.deh@pm.me> | 2021-09-10 07:15:22 -0600 |
|---|---|---|
| committer | Timothy DeHerrera <tim.deh@pm.me> | 2021-09-10 07:33:47 -0600 |
| commit | 47b488287102eba926d4ffbb489529e851cd5f21 (patch) | |
| tree | b8fd03596a2293f5aa693f08bcdf02013eb3368a | |
| parent | Merge pull request #137089 from rnhmjoj/scc-python3 (diff) | |
| download | nixpkgs-origin/fix-toGitINI.tar.gz | |
lib.generators: fix toGitINI when passed a drvorigin/fix-toGitINI
| -rw-r--r-- | lib/generators.nix | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/generators.nix b/lib/generators.nix index bcb0f371a9b5..1e9fa9b8a6d7 100644 --- a/lib/generators.nix +++ b/lib/generators.nix @@ -169,7 +169,8 @@ rec { # converts { a.b.c = 5; } to { "a.b".c = 5; } for toINI gitFlattenAttrs = let recurse = path: value: - if isAttrs value then + assert lib.assertMsg (! lib.isDerivation value) "`${lib.getName value}` is a derivation. If you meant to pass its store path, convert it to a string."; + if isAttrs 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; |
