mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 04:02:55 +03:00
* Add a type for read-only options. Options which are only declared
are used when a module produces read-only data for other modules. svn path=/nixpkgs/trunk/; revision=18148
This commit is contained in:
parent
5684506470
commit
d8bbae877a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user