summary refs log tree commit diff
path: root/lib/types.nix
diff options
context:
space:
mode:
authordanbst <abcz2.uprola@gmail.com>2019-07-25 18:12:15 +0300
committerdanbst <abcz2.uprola@gmail.com>2019-07-25 18:12:15 +0300
commit795383204e2a63a41ca38c6ca021a97c7f5d1775 (patch)
tree5af64382fbed6acb59db3c39650178dc0888fb2e /lib/types.nix
parent2797ddee7ddebbb1292ea7673c42d77bc82b8515 (diff)
downloadnixpkgs-795383204e2a63a41ca38c6ca021a97c7f5d1775.tar
nixpkgs-795383204e2a63a41ca38c6ca021a97c7f5d1775.tar.gz
nixpkgs-795383204e2a63a41ca38c6ca021a97c7f5d1775.tar.bz2
nixpkgs-795383204e2a63a41ca38c6ca021a97c7f5d1775.tar.lz
nixpkgs-795383204e2a63a41ca38c6ca021a97c7f5d1775.tar.xz
nixpkgs-795383204e2a63a41ca38c6ca021a97c7f5d1775.tar.zst
nixpkgs-795383204e2a63a41ca38c6ca021a97c7f5d1775.zip
lib/types: change merge strategy for `str`, `int`, `float` and `enum`
Change to `mergeEqualOption`.
Diffstat (limited to 'lib/types.nix')
-rw-r--r--lib/types.nix10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/types.nix b/lib/types.nix
index b225119299d..e22bcd326c8 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -111,7 +111,7 @@ rec {
         name = "int";
         description = "signed integer";
         check = isInt;
-        merge = mergeOneOption;
+        merge = mergeEqualOption;
       };
 
     # Specialized subdomains of int
@@ -176,14 +176,14 @@ rec {
         name = "float";
         description = "floating point number";
         check = isFloat;
-        merge = mergeOneOption;
+        merge = mergeEqualOption;
     };
 
     str = mkOptionType {
       name = "str";
       description = "string";
       check = isString;
-      merge = mergeOneOption;
+      merge = mergeEqualOption;
     };
 
     strMatching = pattern: mkOptionType {
@@ -243,7 +243,7 @@ rec {
       name = "path";
       # Hacky: there is no ‘isPath’ primop.
       check = x: builtins.substring 0 1 (toString x) == "/";
-      merge = mergeOneOption;
+      merge = mergeEqualOption;
     };
 
     # drop this in the future:
@@ -415,7 +415,7 @@ rec {
         name = "enum";
         description = "one of ${concatMapStringsSep ", " show values}";
         check = flip elem values;
-        merge = mergeOneOption;
+        merge = mergeEqualOption;
         functor = (defaultFunctor name) // { payload = values; binOp = a: b: unique (a ++ b); };
       };