diff --git a/lib/trivial.nix b/lib/trivial.nix index 0bcefcbc28de..fac0718a9e73 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -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; diff --git a/lib/types.nix b/lib/types.nix index 5aa09d33e9b3..cf6f2aa46e40 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -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";