diff --git a/lib/generators.nix b/lib/generators.nix index 073bb6982e1..aa675908703 100644 --- a/lib/generators.nix +++ b/lib/generators.nix @@ -177,13 +177,15 @@ rec { # PLIST handling toPlist = {}: v: let - expr = ind: x: with builtins; - if isNull x then "" else - if isBool x then bool ind x else - if isInt x then int ind x else + isFloat = builtins.isFloat or (x: false); + expr = ind: x: with builtins; + if isNull x then "" else + if isBool x then bool ind x else + if isInt x then int ind x else if isString x then str ind x else - if isList x then list ind x else - if isAttrs x then attrs ind x else + if isList x then list ind x else + if isAttrs x then attrs ind x else + if isFloat x then float ind x else abort "generators.toPlist: should never happen (v = ${v})"; literal = ind: x: ind + x; @@ -192,6 +194,7 @@ rec { int = ind: x: literal ind "${toString x}"; str = ind: x: literal ind "${x}"; key = ind: x: literal ind "${x}"; + float = ind: x: literal ind "${toString x}"; indent = ind: expr "\t${ind}";