diff options
author | Freya Murphy <freya@freyacat.org> | 2025-06-24 16:46:28 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-06-24 16:46:28 -0400 |
commit | d6fbd68749804fa9ca21d4a003c7c86df103aa81 (patch) | |
tree | 105f753d656867e293af054349e0eee958c3bc33 /lib | |
parent | make neovim lsps toggle with development options (diff) | |
download | dotfiles-nix-d6fbd68749804fa9ca21d4a003c7c86df103aa81.tar.gz dotfiles-nix-d6fbd68749804fa9ca21d4a003c7c86df103aa81.tar.bz2 dotfiles-nix-d6fbd68749804fa9ca21d4a003c7c86df103aa81.zip |
use nixpkgs toLua fun
Diffstat (limited to '')
-rw-r--r-- | lib/default.nix | 2 | ||||
-rw-r--r-- | lib/lua.nix | 32 |
2 files changed, 0 insertions, 34 deletions
diff --git a/lib/default.nix b/lib/default.nix index d342bf8..ae838af 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,8 +1,6 @@ {...} @ inputs: let callLibs = file: import file inputs; - lua = callLibs ./lua.nix; files = callLibs ./files.nix; in { - inherit (lua) toLua; inherit (files) getFiles certs sshKeys gpgKeys; } 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; -} |