lib.types.lowerBoundedInt: init
This commit is contained in:
parent
7b8f46c398
commit
3b04273d5c
@ -293,15 +293,21 @@ rec {
|
||||
merge = mergeOneOption;
|
||||
};
|
||||
|
||||
lowerBoundedInt = min: mkOptionType {
|
||||
name = "lower bounded integer";
|
||||
check = x: isInt x && min <= x;
|
||||
merge = mergeOneOption;
|
||||
};
|
||||
|
||||
positive = mkOptionType {
|
||||
inherit (lowerBoundedInt 1) check;
|
||||
name = "positive integer";
|
||||
check = x: isInt x && x > 0;
|
||||
merge = mergeOneOption;
|
||||
};
|
||||
|
||||
uint = mkOptionType {
|
||||
inherit (lowerBoundedInt 0) check;
|
||||
name = "unsigned integer";
|
||||
check = x: isInt x && x >= 0;
|
||||
merge = mergeOneOption;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user