diff options
author | Nicolas Pierron <nicolas.b.pierron@gmail.com> | 2009-11-07 01:58:56 +0000 |
---|---|---|
committer | Nicolas Pierron <nicolas.b.pierron@gmail.com> | 2009-11-07 01:58:56 +0000 |
commit | 10d74af2f640f29b134427002f6c623ae00c864d (patch) | |
tree | a6fbcf0775727b5755617706e2cc4119e6445bbf | |
parent | 2b11697d1a61b7565c53b2e716fd2ce7af84ab80 (diff) |
* Add a type to handle environment variables with the usual string
separator ":". svn path=/nixpkgs/trunk/; revision=18239
-rw-r--r-- | pkgs/lib/types.nix | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/lib/types.nix b/pkgs/lib/types.nix index 01a5d98fca62a..c806e922e3577 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; |