summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-28 16:14:15 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-28 22:45:56 +0100
commitd5047faedef254d01a21618224698c190bb67e5b (patch)
tree42a43de15611b5e35b2888f02fb940365edb1402 /lib
parentf4a418761b481b15900c78b8086e7be58b0afe4e (diff)
downloadnixpkgs-d5047faedef254d01a21618224698c190bb67e5b.tar
nixpkgs-d5047faedef254d01a21618224698c190bb67e5b.tar.gz
nixpkgs-d5047faedef254d01a21618224698c190bb67e5b.tar.bz2
nixpkgs-d5047faedef254d01a21618224698c190bb67e5b.tar.lz
nixpkgs-d5047faedef254d01a21618224698c190bb67e5b.tar.xz
nixpkgs-d5047faedef254d01a21618224698c190bb67e5b.tar.zst
nixpkgs-d5047faedef254d01a21618224698c190bb67e5b.zip
Remove uses of the "merge" option attribute
It's redundant because you can (and should) specify an option type, or
an apply function.
Diffstat (limited to 'lib')
-rw-r--r--lib/options.nix3
-rw-r--r--lib/types.nix6
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/options.nix b/lib/options.nix
index 480837fd1cf..d649d1160a0 100644
--- a/lib/options.nix
+++ b/lib/options.nix
@@ -66,6 +66,9 @@ rec {
          then head list
     else throw "Cannot merge values.";
 
+
+  /* Obsolete, will remove soon.  Specify an option type or apply
+     function instead.  */
   mergeTypedOption = typeName: predicate: merge: list:
     if all predicate list then merge list
     else throw "Expect a ${typeName}.";
diff --git a/lib/types.nix b/lib/types.nix
index 07a6cc69fdc..3c21e34879c 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -71,6 +71,12 @@ rec {
       merge = lib.concatStringsSep "\n";
     };
 
+    commas = mkOptionType {
+      name = "string";
+      check = builtins.isString;
+      merge = lib.concatStringsSep ",";
+    };
+
     envVar = mkOptionType {
       name = "environment variable";
       inherit (string) check;