forked from mirrors/nixpkgs
Merge pull request #42891 from sorki/option_float
lib: add float option type
This commit is contained in:
commit
096fbb33e9
|
@ -102,7 +102,7 @@ rec {
|
|||
# Pull in some builtins not included elsewhere.
|
||||
inherit (builtins)
|
||||
pathExists readFile isBool
|
||||
isInt add sub lessThan
|
||||
isInt isFloat add sub lessThan
|
||||
seq deepSeq genericClosure;
|
||||
|
||||
inherit (lib.strings) fileContents;
|
||||
|
|
|
@ -167,6 +167,13 @@ rec {
|
|||
# s32 = sign 32 4294967296;
|
||||
};
|
||||
|
||||
float = mkOptionType rec {
|
||||
name = "float";
|
||||
description = "floating point number";
|
||||
check = isFloat;
|
||||
merge = mergeOneOption;
|
||||
};
|
||||
|
||||
str = mkOptionType {
|
||||
name = "str";
|
||||
description = "string";
|
||||
|
|
Loading…
Reference in a new issue