74 lines
1.9 KiB
Nix
74 lines
1.9 KiB
Nix
{ config, pkgs,... }:
|
|
{
|
|
programs.nixvim = if config.nixvim-config.enable-ai then {
|
|
extraPlugins = [
|
|
(pkgs.vimUtils.buildVimPlugin {
|
|
name = "avante-nvim";
|
|
src = pkgs.fetchFromGitHub {
|
|
owner = "yetone";
|
|
repo = "avante.nvim";
|
|
rev = "984fe877bfee4cf26e1e5f7e13cc284b6f26bc10";
|
|
hash = "sha256-nSXY7qwXuZsc7qGnqXTpLZZFLshzckwVBmq3TWbwLFY=";
|
|
};
|
|
})
|
|
pkgs.vimPlugins.dressing-nvim
|
|
pkgs.vimPlugins.nui-nvim
|
|
pkgs.vimPlugins.plenary-nvim
|
|
];
|
|
|
|
# Use "post" to make sure dependencies are loaded first
|
|
extraConfigLua = ''
|
|
require('nui')
|
|
require('dressing')
|
|
require('plenary')
|
|
require('avante_lib').load()
|
|
require('avante').setup ({
|
|
provider = "copilot",
|
|
cursor_applying_provider = "copilot",
|
|
behaviour = {
|
|
enable_cursor_planning_mode = true,
|
|
},
|
|
|
|
claude = {
|
|
api_key_name = "<api_key_name>",
|
|
},
|
|
openai = {
|
|
api_key_name = "<api_key_name>",
|
|
},
|
|
|
|
files = {
|
|
auto_include = true, -- Automatically include relevant files
|
|
max_files = 50, ---------------- Maximum number of files to include in context
|
|
max_size_kb = 1000, -- Maximum total size of files in KB
|
|
|
|
-- Define which files to include/exclude
|
|
include = {
|
|
"*.lua",
|
|
"*.nix",
|
|
"*.rs",
|
|
"*.ts",
|
|
"*.js",
|
|
"*.jsx",
|
|
"*.tsx",
|
|
-- Add more patterns as needed
|
|
},
|
|
|
|
exclude = {
|
|
"node_modules/**",
|
|
"dist/**",
|
|
".git/**",
|
|
},
|
|
},
|
|
|
|
web_search_engine = {
|
|
provider = "tavily", -- tavily, serpapi, searchapi, google, kagi
|
|
},
|
|
|
|
-- depends on docker
|
|
rag_service = {
|
|
enable = true, -- requires OPENAI_API_KEY to be set
|
|
},
|
|
})
|
|
'';
|
|
} else {};
|
|
}
|