assistant/avante-nvim: init module

Avante.nvim AI Assistant
This commit is contained in:
Martin Treml 2025-05-18 19:10:04 +02:00
commit dd29532dd1
7 changed files with 85 additions and 0 deletions

View file

@ -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.";
};
};
};
};
}

View file

@ -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"];
};
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./config.nix
./avante-nvim.nix
];
}

View file

@ -1,5 +1,6 @@
{
imports = [
./avante
./chatgpt
./copilot
./codecompanion