Fix evaluation of environment.variables

This commit is contained in:
Eelco Dolstra
2013-10-28 22:45:57 +01:00
parent 9a8516438e
commit e28ea1239f
2 changed files with 10 additions and 6 deletions
+5 -4
View File
@@ -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);
};