diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-28 17:37:28 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-28 22:45:57 +0100 |
commit | e28ea1239fe9413bdb59fd323167b7440b75fc0b (patch) | |
tree | 0b85780be6c32e6ef1dcacaf819114c8d99e2cc1 /nixos/modules/config/shells-environment.nix | |
parent | 9a8516438e93ec61bc37fc6f2e1125df30df2f4b (diff) | |
download | nixlib-e28ea1239fe9413bdb59fd323167b7440b75fc0b.tar nixlib-e28ea1239fe9413bdb59fd323167b7440b75fc0b.tar.gz nixlib-e28ea1239fe9413bdb59fd323167b7440b75fc0b.tar.bz2 nixlib-e28ea1239fe9413bdb59fd323167b7440b75fc0b.tar.lz nixlib-e28ea1239fe9413bdb59fd323167b7440b75fc0b.tar.xz nixlib-e28ea1239fe9413bdb59fd323167b7440b75fc0b.tar.zst nixlib-e28ea1239fe9413bdb59fd323167b7440b75fc0b.zip |
Fix evaluation of environment.variables
Diffstat (limited to 'nixos/modules/config/shells-environment.nix')
-rw-r--r-- | nixos/modules/config/shells-environment.nix | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/nixos/modules/config/shells-environment.nix b/nixos/modules/config/shells-environment.nix index 5b8b6bc600ca..4c40f33532f8 100644 --- a/nixos/modules/config/shells-environment.nix +++ b/nixos/modules/config/shells-environment.nix @@ -26,10 +26,11 @@ in type = types.attrsOf (mkOptionType { name = "a string or a list of strings"; merge = xs: - if isList (head xs) then concatLists xs - else if builtins.lessThan 1 (length xs) then abort "variable in ‘environment.variables’ has multiple values" - else if !builtins.isString (head xs) then abort "variable in ‘environment.variables’ does not have a string value" - else head xs; + let xs' = filterOverrides xs; in + if isList (head xs') then concatLists xs' + else if builtins.lessThan 1 (length xs') then abort "variable in ‘environment.variables’ has multiple values" + else if !builtins.isString (head xs') then abort "variable in ‘environment.variables’ does not have a string value" + else head xs'; }); apply = mapAttrs (n: v: if isList v then concatStringsSep ":" v else v); }; |