summary refs log tree commit diff
path: root/lib/generators.nix
diff options
context:
space:
mode:
authorLéo Gaspard2018-10-14 02:55:00 +0900
committerProfpatsch2018-10-15 14:03:16 +0200
commit455e0ed88527d69a9c4a52e1238d35ec61556257 (patch)
treeec36a00446e8ec504496d14e175ca7c7af4c9fba /lib/generators.nix
parent5b343e7e8b5bd0132546bde40a0e3b6b639347eb (diff)
generators: make toPretty handle floats correctly
Diffstat (limited to 'lib/generators.nix')
-rw-r--r--lib/generators.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/generators.nix b/lib/generators.nix
index f5faf7007860..863ba847423e 100644
--- a/lib/generators.nix
+++ b/lib/generators.nix
@@ -143,6 +143,7 @@ rec {
   }@args: v: with builtins;
     let     isPath   = v: typeOf v == "path";
     in if   isInt      v then toString v
+    else if isFloat    v then "~${toString v}"
     else if isString   v then ''"${libStr.escape [''"''] v}"''
     else if true  ==   v then "true"
     else if false ==   v then "false"