diff --git a/pkgs/lib/types.nix b/pkgs/lib/types.nix index 8b0f61549b5..01a5d98fca6 100644 --- a/pkgs/lib/types.nix +++ b/pkgs/lib/types.nix @@ -110,6 +110,12 @@ rec { throw "Multiple definitions. Only one is allowed for this option."; }; + none = elemType: mkOptionType { + inherit (elemType) name check iter fold docPath hasOptions; + merge = list: + throw "No definitions are allowed for this option."; + }; + nullOr = elemType: mkOptionType { inherit (elemType) name merge docPath hasOptions; check = x: builtins.isNull x || elemType.check x;