summary refs log tree commit diff
path: root/pkgs/lib/types.nix
diff options
context:
space:
mode:
authorNicolas Pierron <nicolas.b.pierron@gmail.com>2009-11-07 01:58:56 +0000
committerNicolas Pierron <nicolas.b.pierron@gmail.com>2009-11-07 01:58:56 +0000
commit10d74af2f640f29b134427002f6c623ae00c864d (patch)
treea6fbcf0775727b5755617706e2cc4119e6445bbf /pkgs/lib/types.nix
parent2b11697d1a61b7565c53b2e716fd2ce7af84ab80 (diff)
downloadnixpkgs-10d74af2f640f29b134427002f6c623ae00c864d.tar
nixpkgs-10d74af2f640f29b134427002f6c623ae00c864d.tar.gz
nixpkgs-10d74af2f640f29b134427002f6c623ae00c864d.tar.bz2
nixpkgs-10d74af2f640f29b134427002f6c623ae00c864d.tar.lz
nixpkgs-10d74af2f640f29b134427002f6c623ae00c864d.tar.xz
nixpkgs-10d74af2f640f29b134427002f6c623ae00c864d.tar.zst
nixpkgs-10d74af2f640f29b134427002f6c623ae00c864d.zip
* Add a type to handle environment variables with the usual string
  separator ":".

svn path=/nixpkgs/trunk/; revision=18239
Diffstat (limited to 'pkgs/lib/types.nix')
-rw-r--r--pkgs/lib/types.nix8
1 files changed, 7 insertions, 1 deletions
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;