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:
@@ -154,7 +154,7 @@ in
|
|||||||
${concatStringsSep "\n" (
|
${concatStringsSep "\n" (
|
||||||
(mapAttrsToList (n: v: ''export ${n}="${concatStringsSep ":" v}"'')
|
(mapAttrsToList (n: v: ''export ${n}="${concatStringsSep ":" v}"'')
|
||||||
# This line is a kind of a hack because of !!! note above
|
# 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}
|
${cfg.extraInit}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user