From 8658ea13a2bd60c0fb78944bd23e0a009ae2c93b Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 18 Apr 2023 02:01:45 +0300 Subject: [PATCH] feat(lib): lua namespace for conversion helpers --- lib/booleans.nix | 9 --------- lib/default.nix | 1 + lib/lua.nix | 12 ++++++++++++ lib/types/plugins.nix | 1 + 4 files changed, 14 insertions(+), 9 deletions(-) delete mode 100644 lib/booleans.nix create mode 100644 lib/lua.nix diff --git a/lib/booleans.nix b/lib/booleans.nix deleted file mode 100644 index 277dd18c..00000000 --- a/lib/booleans.nix +++ /dev/null @@ -1,9 +0,0 @@ -# From home-manager: https://github.com/nix-community/home-manager/blob/master/modules/lib/booleans.nix -{lib}: { - # Converts a boolean to a yes/no string. This is used in lots of - # configuration formats. - yesNo = value: - if value - then "yes" - else "no"; -} diff --git a/lib/default.nix b/lib/default.nix index 37840c17..ad6771a1 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -4,4 +4,5 @@ types = import ./types {inherit lib;}; languages = import ./languages.nix {inherit lib;}; nmd = import ./nmd.nix; + lua = import ./lua.nix {inherit lib;}; } diff --git a/lib/lua.nix b/lib/lua.nix new file mode 100644 index 00000000..b21c459e --- /dev/null +++ b/lib/lua.nix @@ -0,0 +1,12 @@ +# Helpers for converting values to lua +{lib}: { + yesNo = value: + if value + then "yes" + else "no"; + + nullString = value: + if value == null + then "nil" + else "'${value}'"; +} diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index 3ff9dd1a..770a47a2 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -41,6 +41,7 @@ with lib; let "rust-tools" "onedark" "catppuccin" + "dracula" "minimap-vim" "dashboard-nvim" "alpha-nvim"