mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
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:
parent
2b4a1a1d4f
commit
bd285d2c11
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user