{ config, ... }: { programs.nixvim.plugins = if config.nixvim-config.enable-ai then { ## required dependencies dressing.enable = true; # this is archived and may break in the future nui.enable = true; ## optional dependencies cmp.enable = true; copilot-lua.enable = true; fzf-lua.enable = true; mini.enable = true; telescope.enable = true; web-devicons.enable = true; avante = { enable = true; settings = { provider = "copilot"; cursor_applying_provider = "copilot"; behaviour = { enable_cursor_planning_mode = true; }; web_search_engine = { provider = "tavily"; # tavily, serpapi, searchapi, google, kagi }; # depends on docker rag_service = { enable = false; # requires OPENAI_API_KEY to be set }; 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/**" # Add more patterns to exclude ]; }; claude = { api_key_name = ""; }; openai = { api_key_name = ""; }; vendors = { ollama = { api_key_name = ""; endpoint = "http://localhost:11434/v1"; model = "hf.co/unsloth/DeepSeek-R1-Distill-Qwen-1.5B-GGUF"; temperature = "0.6"; parse_curl_args.__raw = '' function(opts, code_opts) return { url = opts.endpoint .. "/chat/completions", headers = { ["Accept"] = "application/json", ["Content-Type"] = "application/json", ["x-api-key"] = "ollama", }, body = { model = opts.model, messages = require("avante.providers").copilot.parse_messages(code_opts), max_tokens = opts.max_tokens, stream = true, }, } end''; parse_response_data.__raw = '' function(data_stream, event_state, opts) require("avante.providers").openai.parse_response(data_stream, event_state, opts) end''; }; }; ## Default keybindings: # aa - ask # ae - edit # ar - refresh # af - focus # co - choose ours # ct - choose theirs # ca - choose all theirs # c0 - choose none # cb - choose both # cc - choose cursor # ]x - previous conflict # [x - next conflict # [[ - previous code block # ]] - next code block # mappings = { # ask = "ca"; # edit = "ce"; # refresh = "cr"; # focus = "cf"; # toggle = { # default = "ct"; # debug = "cd"; # hint = "ch"; # suggestion = "cs"; # repomap = "cR"; # }; # files = { # add_current = "cc"; # }; # }; }; }; } else {}; }