From f70fbb179128e795fcc6d07c52454c1dbcaa196a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 25 Sep 2013 00:48:28 +0200 Subject: [PATCH] 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. --- modules/config/shells-environment.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/config/shells-environment.nix b/modules/config/shells-environment.nix index f1ce492d8165..4f7447f435bc 100644 --- a/modules/config/shells-environment.nix +++ b/modules/config/shells-environment.nix @@ -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}