summaryrefslogtreecommitdiff
path: root/lib/lua.nix
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-06-24 16:46:28 -0400
committerFreya Murphy <freya@freyacat.org>2025-06-24 16:46:28 -0400
commitd6fbd68749804fa9ca21d4a003c7c86df103aa81 (patch)
tree105f753d656867e293af054349e0eee958c3bc33 /lib/lua.nix
parentmake neovim lsps toggle with development options (diff)
downloaddotfiles-nix-d6fbd68749804fa9ca21d4a003c7c86df103aa81.tar.gz
dotfiles-nix-d6fbd68749804fa9ca21d4a003c7c86df103aa81.tar.bz2
dotfiles-nix-d6fbd68749804fa9ca21d4a003c7c86df103aa81.zip
use nixpkgs toLua fun
Diffstat (limited to '')
-rw-r--r--lib/lua.nix32
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;
-}