From dd29532dd17483310f8c711520a906d3a8be2e95 Mon Sep 17 00:00:00 2001 From: Martin Treml Date: Sun, 18 May 2025 19:10:04 +0200 Subject: [PATCH] assistant/avante-nvim: init module Avante.nvim AI Assistant --- configuration.nix | 1 + docs/release-notes/rl-0.8.md | 5 +++ .../plugins/assistant/avante/avante-nvim.nix | 25 ++++++++++++++ modules/plugins/assistant/avante/config.nix | 34 +++++++++++++++++++ modules/plugins/assistant/avante/default.nix | 6 ++++ modules/plugins/assistant/default.nix | 1 + npins/sources.json | 13 +++++++ 7 files changed, 85 insertions(+) create mode 100644 modules/plugins/assistant/avante/avante-nvim.nix create mode 100644 modules/plugins/assistant/avante/config.nix create mode 100644 modules/plugins/assistant/avante/default.nix diff --git a/configuration.nix b/configuration.nix index dee5001f..75c82453 100644 --- a/configuration.nix +++ b/configuration.nix @@ -248,6 +248,7 @@ isMaximal: { cmp.enable = isMaximal; }; codecompanion-nvim.enable = false; + avante-nvim.enable = true; }; session = { diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 1f10476f..d72afaef 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -407,3 +407,8 @@ - Add [img-clip.nvim] plugin in `vim.utility.images.img-clip` with `enable` and `setupOpts` - Add `vim.utility.images.img-clip.enable = isMaximal` in configuration.nix + +[Munsio](https://github.com/munsio): + +- Add [avante.nvim](https://github.com/yetone/avante.nvim) plugin another AI + Assistant. diff --git a/modules/plugins/assistant/avante/avante-nvim.nix b/modules/plugins/assistant/avante/avante-nvim.nix new file mode 100644 index 00000000..90879a4d --- /dev/null +++ b/modules/plugins/assistant/avante/avante-nvim.nix @@ -0,0 +1,25 @@ +{lib, ...}: let + inherit (lib.options) mkOption mkEnableOption; + inherit (lib.types) str nullOr; + inherit (lib.nvim.types) mkPluginSetupOption luaInline; +in { + options.vim.assistant = { + avante-nvim = { + enable = mkEnableOption "complementary neovim plugin for avante.nvim"; + + setupOpts = mkPluginSetupOption "avante-nvim" { + provider = mkOption { + type = nullOr str; + default = null; + description = "Provider used for Chat."; + }; + + vendors = mkOption { + type = nullOr luaInline; + default = null; + description = "A provider is what connects Neovim to an LLM."; + }; + }; + }; + }; +} diff --git a/modules/plugins/assistant/avante/config.nix b/modules/plugins/assistant/avante/config.nix new file mode 100644 index 00000000..32c65774 --- /dev/null +++ b/modules/plugins/assistant/avante/config.nix @@ -0,0 +1,34 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf; + + cfg = config.vim.assistant.avante-nvim; +in { + config = mkIf cfg.enable { + vim = { + startPlugins = [ + "dressing-nvim" + "nui-nvim" + "plenary-nvim" + ]; + + lazy.plugins = { + avante-nvim = { + package = "avante-nvim"; + setupModule = "avante"; + inherit (cfg) setupOpts; + }; + }; + + treesitter.enable = true; + + autocomplete.nvim-cmp = { + sources = {avante-nvim = "[avante]";}; + sourcePlugins = ["avante-nvim"]; + }; + }; + }; +} diff --git a/modules/plugins/assistant/avante/default.nix b/modules/plugins/assistant/avante/default.nix new file mode 100644 index 00000000..c8ab1a1c --- /dev/null +++ b/modules/plugins/assistant/avante/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./config.nix + ./avante-nvim.nix + ]; +} diff --git a/modules/plugins/assistant/default.nix b/modules/plugins/assistant/default.nix index 697d54f6..b14f6f92 100644 --- a/modules/plugins/assistant/default.nix +++ b/modules/plugins/assistant/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./avante ./chatgpt ./copilot ./codecompanion diff --git a/npins/sources.json b/npins/sources.json index 940a7466..e036b857 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -26,6 +26,19 @@ "url": "https://github.com/goolord/alpha-nvim/archive/de72250e054e5e691b9736ee30db72c65d560771.tar.gz", "hash": "0c1jkhxamfn2md7m1r5b2wpxa26y90b98yzjwf68m3fymalvkn5h" }, + "avante-nvim": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "yetone", + "repo": "avante.nvim" + }, + "branch": "main", + "submodules": false, + "revision": "e98bb8d3bae102662c5ad4ada1ce63a9aacac4e0", + "url": "https://github.com/yetone/avante.nvim/archive/e98bb8d3bae102662c5ad4ada1ce63a9aacac4e0.tar.gz", + "hash": "1x1xs80bmh3w0xnpjanwl8qwqz0lm7d2cmsvgd1p4jki1shllb8y" + }, "base16": { "type": "Git", "repository": {