From d5082e5ef24a97cd3245389e750d13e8e82c46aa Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 27 Feb 2023 22:28:06 +0300 Subject: [PATCH] feat: apply new module format to snippet plugins --- modules/snippets/default.nix | 9 ++------- modules/snippets/vsnip/config.nix | 14 ++++++++++++++ modules/snippets/vsnip/default.nix | 5 +++++ modules/snippets/{ => vsnip}/vsnip.nix | 4 ---- 4 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 modules/snippets/vsnip/config.nix create mode 100644 modules/snippets/vsnip/default.nix rename modules/snippets/{ => vsnip}/vsnip.nix (72%) diff --git a/modules/snippets/default.nix b/modules/snippets/default.nix index dd88e3c6..cde3f7c5 100644 --- a/modules/snippets/default.nix +++ b/modules/snippets/default.nix @@ -1,10 +1,5 @@ -{ - pkgs, - lib, - config, - ... -}: { +_: { imports = [ - ./vsnip.nix + ./vsnip ]; } diff --git a/modules/snippets/vsnip/config.nix b/modules/snippets/vsnip/config.nix new file mode 100644 index 00000000..b1753280 --- /dev/null +++ b/modules/snippets/vsnip/config.nix @@ -0,0 +1,14 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; +with builtins; let + cfg = config.vim.snippets.vsnip; +in { + config = mkIf cfg.enable { + vim.startPlugins = ["vim-vsnip"]; + }; +} diff --git a/modules/snippets/vsnip/default.nix b/modules/snippets/vsnip/default.nix new file mode 100644 index 00000000..fee36eba --- /dev/null +++ b/modules/snippets/vsnip/default.nix @@ -0,0 +1,5 @@ +_: { + imports = [ + ./vsnip.nix + ]; +} diff --git a/modules/snippets/vsnip.nix b/modules/snippets/vsnip/vsnip.nix similarity index 72% rename from modules/snippets/vsnip.nix rename to modules/snippets/vsnip/vsnip.nix index 671671c8..1049651d 100644 --- a/modules/snippets/vsnip.nix +++ b/modules/snippets/vsnip/vsnip.nix @@ -11,8 +11,4 @@ in { options.vim.snippets.vsnip = { enable = mkEnableOption "Enable vim-vsnip"; }; - - config = mkIf cfg.enable { - vim.startPlugins = ["vim-vsnip"]; - }; }