From 10d74af2f640f29b134427002f6c623ae00c864d Mon Sep 17 00:00:00 2001 From: Nicolas Pierron Date: Sat, 7 Nov 2009 01:58:56 +0000 Subject: * Add a type to handle environment variables with the usual string separator ":". svn path=/nixpkgs/trunk/; revision=18239 --- pkgs/lib/types.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'pkgs/lib/types.nix') diff --git a/pkgs/lib/types.nix b/pkgs/lib/types.nix index 01a5d98fca6..c806e922e35 100644 --- a/pkgs/lib/types.nix +++ b/pkgs/lib/types.nix @@ -40,7 +40,7 @@ rec { }; - types = { + types = rec { inferred = mkOptionType { name = "inferred type"; @@ -63,6 +63,12 @@ rec { merge = lib.concatStrings; }; + envVar = mkOptionType { + name = "environment variable"; + inherit (string) check; + merge = lib.concatStringsSep ":"; + }; + attrs = mkOptionType { name = "attribute set"; check = lib.traceValIfNot builtins.isAttrs; -- cgit 1.4.1