Fix duplicated environment values

All profileVariables listed each profile twice (e.g. $PATH contained
$HOME/.nix-profile/bin twice).  This is because mergeAttrsWithFunc is
broken (and deprecated):

  nix-repl> :p mergeAttrsWithFunc concat { x = [1]; } { y = [2]; }
  { x = [ 1 ]; y = [ 2 2 ]; }

So use zipAttrsWith instead.
This commit is contained in:
Eelco Dolstra 2013-09-25 00:48:28 +02:00
parent cfd20debfb
commit f70fbb1791

View File

@ -154,7 +154,7 @@ in
${concatStringsSep "\n" (
(mapAttrsToList (n: v: ''export ${n}="${concatStringsSep ":" v}"'')
# This line is a kind of a hack because of !!! note above
(fold (mergeAttrsWithFunc concat) {} ([ (mapAttrs (n: v: [ v ]) cfg.variables) ] ++ map cfg.profileVariables cfg.profiles))))}
(zipAttrsWith (const concatLists) ([ (mapAttrs (n: v: [ v ]) cfg.variables) ] ++ map cfg.profileVariables cfg.profiles))))}
${cfg.extraInit}