about summary refs log tree commit diff
path: root/lib/types.nix
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2024-02-04 15:48:27 +0100
committerRobert Hensing <robert@roberthensing.nl>2024-02-04 15:49:55 +0100
commitbd285d2c11a4d906ba5a15ee2472f33dfa113546 (patch)
treed36830cd55e146a3cb4002d960c2f2b1c7baf518 /lib/types.nix
parent2b4a1a1d4f9db1b7007966d6205645acc5f7e57b (diff)
lib.types.uniq: Check inner type
We now reuse the `unique` type, which implements this.
Keeping the duplication around would be bad at this point.
Diffstat (limited to 'lib/types.nix')
-rw-r--r--lib/types.nix13
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/types.nix b/lib/types.nix
index 284c8df24f674..e6353e3f43c73 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -613,18 +613,7 @@ rec {
       nestedTypes.elemType = elemType;
     };
 
-    # Value of given type but with no merging (i.e. `uniq list`s are not concatenated).
-    uniq = elemType: mkOptionType rec {
-      name = "uniq";
-      inherit (elemType) description descriptionClass check;
-      merge = mergeOneOption;
-      emptyValue = elemType.emptyValue;
-      getSubOptions = elemType.getSubOptions;
-      getSubModules = elemType.getSubModules;
-      substSubModules = m: uniq (elemType.substSubModules m);
-      functor = (defaultFunctor name) // { wrapped = elemType; };
-      nestedTypes.elemType = elemType;
-    };
+    uniq = unique { message = ""; };
 
     unique = { message }: type: mkOptionType rec {
       name = "unique";