mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 13:10:33 +00:00
lib: add float option type
This commit is contained in:
parent
366cd2ad8c
commit
4a310a0404
|
@ -102,7 +102,7 @@ rec {
|
||||||
# Pull in some builtins not included elsewhere.
|
# Pull in some builtins not included elsewhere.
|
||||||
inherit (builtins)
|
inherit (builtins)
|
||||||
pathExists readFile isBool
|
pathExists readFile isBool
|
||||||
isInt add sub lessThan
|
isInt isFloat add sub lessThan
|
||||||
seq deepSeq genericClosure;
|
seq deepSeq genericClosure;
|
||||||
|
|
||||||
inherit (lib.strings) fileContents;
|
inherit (lib.strings) fileContents;
|
||||||
|
|
|
@ -167,6 +167,13 @@ rec {
|
||||||
# s32 = sign 32 4294967296;
|
# s32 = sign 32 4294967296;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
float = mkOptionType rec {
|
||||||
|
name = "float";
|
||||||
|
description = "floating point number";
|
||||||
|
check = isFloat;
|
||||||
|
merge = mergeOneOption;
|
||||||
|
};
|
||||||
|
|
||||||
str = mkOptionType {
|
str = mkOptionType {
|
||||||
name = "str";
|
name = "str";
|
||||||
description = "string";
|
description = "string";
|
||||||
|
|
Loading…
Reference in a new issue