lib.types.boundedInt: init
This commit is contained in:
parent
90b46307b5
commit
7b8f46c398
@ -287,6 +287,12 @@ rec {
|
||||
};
|
||||
});
|
||||
|
||||
boundedInt = min: max: mkOptionType {
|
||||
name = "bounded integer";
|
||||
check = x: isInt x && min <= x && x <= max;
|
||||
merge = mergeOneOption;
|
||||
};
|
||||
|
||||
positive = mkOptionType {
|
||||
name = "positive integer";
|
||||
check = x: isInt x && x > 0;
|
||||
|
Loading…
Reference in New Issue
Block a user