diff options
Diffstat (limited to 'lib/lua.nix')
-rw-r--r-- | lib/lua.nix | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/lib/lua.nix b/lib/lua.nix deleted file mode 100644 index 9bde6bb..0000000 --- a/lib/lua.nix +++ /dev/null @@ -1,32 +0,0 @@ -{lib, ...}: let - toLua = val: - # nil - if val == null - then "nil" - # boolean - else if builtins.isBool val - then - if val - then "true" - else "false" - # number - else if builtins.isInt val || builtins.isFloat val - then toString val - # string - else if builtins.isString val - then "'${val}'" - # table (array) - else if builtins.isList val - then "{ " + (lib.concatStringsSep ", " (map toLua val)) + " }" - # table (object) - else if builtins.isAttrs val - then - "{ " - + (lib.concatStringsSep ", " - (lib.mapAttrsToList (k: v: "${k} = ${toLua v}") val)) - + " }" - # invalid - else throw "Unsupported value: ${toString val}"; -in { - inherit toLua; -} |