aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/lib/generators.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/lib/generators.nix')
-rw-r--r--nixpkgs/lib/generators.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/nixpkgs/lib/generators.nix b/nixpkgs/lib/generators.nix
index efe6ea6031d..abd237eb7d3 100644
--- a/nixpkgs/lib/generators.nix
+++ b/nixpkgs/lib/generators.nix
@@ -48,8 +48,10 @@ rec {
else if isAttrs v then err "attrsets" v
# functions can’t be printed of course
else if isFunction v then err "functions" v
- # let’s not talk about floats. There is no sensible `toString` for them.
- else if isFloat v then err "floats" v
+ # Floats currently can't be converted to precise strings,
+ # condition warning on nix version once this isn't a problem anymore
+ # See https://github.com/NixOS/nix/pull/3480
+ else if isFloat v then libStr.floatToString v
else err "this value is" (toString v);