From cbf1490308bca91b9f8348cfda4785d9be365a55 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 27 Feb 2023 22:28:37 +0300 Subject: [PATCH] feat: apply new module format to terminal plugins --- modules/terminal/default.nix | 2 +- .../{toggleterm.nix => toggleterm/config.nix} | 14 ----------- modules/terminal/toggleterm/default.nix | 6 +++++ modules/terminal/toggleterm/toggleterm.nix | 24 +++++++++++++++++++ 4 files changed, 31 insertions(+), 15 deletions(-) rename modules/terminal/{toggleterm.nix => toggleterm/config.nix} (68%) create mode 100644 modules/terminal/toggleterm/default.nix create mode 100644 modules/terminal/toggleterm/toggleterm.nix diff --git a/modules/terminal/default.nix b/modules/terminal/default.nix index 228f3ff..c8bbc22 100644 --- a/modules/terminal/default.nix +++ b/modules/terminal/default.nix @@ -1,5 +1,5 @@ _: { imports = [ - ./toggleterm.nix + ./toggleterm ]; } diff --git a/modules/terminal/toggleterm.nix b/modules/terminal/toggleterm/config.nix similarity index 68% rename from modules/terminal/toggleterm.nix rename to modules/terminal/toggleterm/config.nix index 7c7f5b5..89ed51c 100644 --- a/modules/terminal/toggleterm.nix +++ b/modules/terminal/toggleterm/config.nix @@ -8,20 +8,6 @@ with lib; with builtins; let cfg = config.vim.terminal.toggleterm; in { - options.vim.terminal.toggleterm = { - enable = mkEnableOption "Enable toggleterm as a replacement to built-in terminal command"; - direction = mkOption { - type = types.enum ["horizontal" "vertical" "tab" "float"]; - default = "float"; - description = "Direction of the terminal"; - }; - enable_winbar = mkOption { - type = types.bool; - default = false; - description = "Enable winbar"; - }; - }; - config = mkIf cfg.enable { vim.startPlugins = [ "toggleterm-nvim" diff --git a/modules/terminal/toggleterm/default.nix b/modules/terminal/toggleterm/default.nix new file mode 100644 index 0000000..a540f3f --- /dev/null +++ b/modules/terminal/toggleterm/default.nix @@ -0,0 +1,6 @@ +_: { + imports = [ + ./toggleterm.nix + ./config.nix + ]; +} diff --git a/modules/terminal/toggleterm/toggleterm.nix b/modules/terminal/toggleterm/toggleterm.nix new file mode 100644 index 0000000..3383780 --- /dev/null +++ b/modules/terminal/toggleterm/toggleterm.nix @@ -0,0 +1,24 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; +with builtins; let + cfg = config.vim.terminal.toggleterm; +in { + options.vim.terminal.toggleterm = { + enable = mkEnableOption "Enable toggleterm as a replacement to built-in terminal command"; + direction = mkOption { + type = types.enum ["horizontal" "vertical" "tab" "float"]; + default = "horizontal"; + description = "Direction of the terminal"; + }; + enable_winbar = mkOption { + type = types.bool; + default = false; + description = "Enable winbar"; + }; + }; +}