Fix evaluation of environment.variables
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user