From ba98b2d627532f5bfda04082fc76ba9dc51377d0 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 14 Apr 2024 15:49:16 +0300 Subject: [PATCH] plugins/neo-tree: init module --- flake.nix | 5 +++++ modules/plugins/filetree/default.nix | 1 + modules/plugins/filetree/neo-tree/config.nix | 20 +++++++++++++++++++ modules/plugins/filetree/neo-tree/default.nix | 6 ++++++ .../plugins/filetree/neo-tree/neo-tree.nix | 9 +++++++++ modules/plugins/filetree/nvimtree/default.nix | 2 +- 6 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 modules/plugins/filetree/neo-tree/config.nix create mode 100644 modules/plugins/filetree/neo-tree/default.nix create mode 100644 modules/plugins/filetree/neo-tree/neo-tree.nix diff --git a/flake.nix b/flake.nix index cc741b4..a7c48cd 100644 --- a/flake.nix +++ b/flake.nix @@ -217,6 +217,11 @@ flake = false; }; + plugin-neo-tree-nvim = { + url = "github:nvim-neo-tree/neo-tree.nvim"; + flake = false; + }; + # Tablines plugin-nvim-bufferline-lua = { url = "github:akinsho/nvim-bufferline.lua"; diff --git a/modules/plugins/filetree/default.nix b/modules/plugins/filetree/default.nix index 1441b4f..0e930c7 100644 --- a/modules/plugins/filetree/default.nix +++ b/modules/plugins/filetree/default.nix @@ -1,5 +1,6 @@ { imports = [ ./nvimtree + ./neo-tree ]; } diff --git a/modules/plugins/filetree/neo-tree/config.nix b/modules/plugins/filetree/neo-tree/config.nix new file mode 100644 index 0000000..4b41aef --- /dev/null +++ b/modules/plugins/filetree/neo-tree/config.nix @@ -0,0 +1,20 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf; + + cfg = config.vim.filetree.neo-tree; +in { + config = mkIf cfg.enable { + vim.startPlugins = [ + # dependencies + "plenary-nvim" # commons library + "image-nvim" # optional for image previews + "nui-nvim" # ui library + # neotree + "neo-tree-nvim" + ]; + }; +} diff --git a/modules/plugins/filetree/neo-tree/default.nix b/modules/plugins/filetree/neo-tree/default.nix new file mode 100644 index 0000000..7ecf12b --- /dev/null +++ b/modules/plugins/filetree/neo-tree/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./config.nix + ./neo-tree.nix + ]; +} diff --git a/modules/plugins/filetree/neo-tree/neo-tree.nix b/modules/plugins/filetree/neo-tree/neo-tree.nix new file mode 100644 index 0000000..5fa3bca --- /dev/null +++ b/modules/plugins/filetree/neo-tree/neo-tree.nix @@ -0,0 +1,9 @@ +{lib, ...}: let + inherit (lib.options) mkEnableOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.filetree.nvimTree = { + enable = mkEnableOption "filetree via neo-tree.nvim"; + setupOpts = mkPluginSetupOption "neo-tree" {}; + }; +} diff --git a/modules/plugins/filetree/nvimtree/default.nix b/modules/plugins/filetree/nvimtree/default.nix index 730ee5f..5a334e8 100644 --- a/modules/plugins/filetree/nvimtree/default.nix +++ b/modules/plugins/filetree/nvimtree/default.nix @@ -1,4 +1,4 @@ -_: { +{ imports = [ ./config.nix ./nvimtree.nix