summaryrefslogtreecommitdiff
path: root/lib/lua.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/lua.nix10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/lua.nix b/lib/lua.nix
index 704cdfa..6f6389e 100644
--- a/lib/lua.nix
+++ b/lib/lua.nix
@@ -1,6 +1,6 @@
{lib, ...}: let
- fmt = val:
- # nil
+ toLua = val:
+ # nil
if val == null
then "nil"
# boolean
@@ -17,16 +17,16 @@
then "'${val}'"
# table (array)
else if builtins.isList val
- then "{ " + (lib.concatStringsSep ", " (map fmt val)) + " }"
+ then "{ " + (lib.concatStringsSep ", " (map toLua val)) + " }"
# table (object)
else if builtins.isAttrs val
then
"{ "
+ (lib.concatStringsSep ", "
- (lib.mapAttrsToList (k: v: "${k} = ${fmt v}") val))
+ (lib.mapAttrsToList (k: v: "${k} = ${toLua v}") val))
+ " }"
# invalid
else throw "Unsupported value: ${toString val}";
in {
- fmt = fmt;
+ inherit toLua;
}