diff options
author | Jan Malakhovski <oxij@oxij.org> | 2015-08-17 17:55:35 +0000 |
---|---|---|
committer | Jan Malakhovski <oxij@oxij.org> | 2015-09-18 18:48:49 +0000 |
commit | 33ae3f2fe4baeb4db19d3c90dbb6cd35b9373004 (patch) | |
tree | 3315c48510babeec50d8ca84acb41689546e7acd /nixos/modules/config/shells-environment.nix | |
parent | c8ea6c07c655ba70cf46c52063276bfcfa5b1643 (diff) | |
download | nixlib-33ae3f2fe4baeb4db19d3c90dbb6cd35b9373004.tar nixlib-33ae3f2fe4baeb4db19d3c90dbb6cd35b9373004.tar.gz nixlib-33ae3f2fe4baeb4db19d3c90dbb6cd35b9373004.tar.bz2 nixlib-33ae3f2fe4baeb4db19d3c90dbb6cd35b9373004.tar.lz nixlib-33ae3f2fe4baeb4db19d3c90dbb6cd35b9373004.tar.xz nixlib-33ae3f2fe4baeb4db19d3c90dbb6cd35b9373004.tar.zst nixlib-33ae3f2fe4baeb4db19d3c90dbb6cd35b9373004.zip |
nixos,lib: move environment generation related copy-paste to lib
Diffstat (limited to 'nixos/modules/config/shells-environment.nix')
-rw-r--r-- | nixos/modules/config/shells-environment.nix | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/nixos/modules/config/shells-environment.nix b/nixos/modules/config/shells-environment.nix index bff0b2991323..533280890a70 100644 --- a/nixos/modules/config/shells-environment.nix +++ b/nixos/modules/config/shells-environment.nix @@ -41,20 +41,7 @@ in strings. The latter is concatenated, interspersed with colon characters. ''; - type = types.attrsOf (mkOptionType { - name = "a string or a list of strings"; - merge = loc: defs: - let - defs' = filterOverrides defs; - res = (head defs').value; - in - if isList res then concatLists (getValues defs') - else if lessThan 1 (length defs') then - throw "The option `${showOption loc}' is defined multiple times, in ${showFiles (getFiles defs)}." - else if !isString res then - throw "The option `${showOption loc}' does not have a string value, in ${showFiles (getFiles defs)}." - else res; - }); + type = types.attrsOf (types.loeOf types.str); apply = mapAttrs (n: v: if isList v then concatStringsSep ":" v else v); }; |