* 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:
Nicolas Pierron 2009-11-05 15:39:45 +00:00
parent 5684506470
commit d8bbae877a

View File

@ -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;