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.
This commit is contained in:
Robert Hensing 2024-02-04 15:48:27 +01:00
parent 2b4a1a1d4f
commit bd285d2c11

View File

@ -613,18 +613,7 @@ rec {
nestedTypes.elemType = elemType; nestedTypes.elemType = elemType;
}; };
# Value of given type but with no merging (i.e. `uniq list`s are not concatenated). uniq = unique { message = ""; };
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;
};
unique = { message }: type: mkOptionType rec { unique = { message }: type: mkOptionType rec {
name = "unique"; name = "unique";