From 33ae3f2fe4baeb4db19d3c90dbb6cd35b9373004 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Mon, 17 Aug 2015 17:55:35 +0000 Subject: nixos,lib: move environment generation related copy-paste to lib --- nixos/modules/config/shells-environment.nix | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'nixos/modules/config/shells-environment.nix') 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); }; -- cgit 1.4.1