diff --git a/home/default.nix b/home/default.nix index 758aba3..eb9bb45 100644 --- a/home/default.nix +++ b/home/default.nix @@ -11,7 +11,7 @@ username = primaryUser; stateVersion = "25.11"; sessionVariables = { - # shared environment variables + GROQ_API_KEY = "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"; }; file = { diff --git a/home/neovim/avante.nix b/home/neovim/avante.nix new file mode 100644 index 0000000..505d442 --- /dev/null +++ b/home/neovim/avante.nix @@ -0,0 +1,98 @@ +{ pkgs, ... }: { + # Avante: AI-powered coding assistant (Cursor-like experience in Neovim) + programs.nixvim = { + extraConfigLuaPre = '' + vim.env.GROQ_API_KEY = os.getenv("GROQ_API_KEY") + ''; + + plugins.avante = { + enable = true; + autoLoad = true; + settings = { + provider = "groq"; + + providers.groq = { + __inherited_from = "openai"; + api_key_name = + "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"; + endpoint = "https://api.groq.com/openai/v1/"; + model = "llama-3.3-70b-versatile"; + disable_tools = true; + extra_request_body = { + temperature = 1; + max_tokens = 32768; + }; + }; + + auto_suggestions_provider = "copilot"; + + behaviour = { + auto_suggestions = true; + auto_set_highlight_group = true; + auto_set_keymaps = true; + auto_apply_diff_after_generation = false; + support_paste_from_clipboard = false; + }; + + mappings = { + ask = "aa"; + edit = "ae"; + refresh = "ar"; + diff = { + ours = "co"; + theirs = "ct"; + all_theirs = "ca"; + both = "cb"; + cursor = "cc"; + next = "]x"; + prev = "[x"; + }; + suggestion = { + accept = ""; + next = ""; + prev = ""; + dismiss = ""; + }; + jump = { + next = "]]"; + prev = "[["; + }; + submit = { + normal = ""; + insert = ""; + }; + sidebar = { + switch_windows = ""; + reverse_switch_windows = ""; + }; + }; + + hints = { enabled = true; }; + + windows = { + position = "right"; + wrap = true; + width = 30; + sidebar_header = { + align = "center"; + rounded = true; + }; + }; + + highlights = { + diff = { + current = "DiffText"; + incoming = "DiffAdd"; + }; + }; + + diff = { + autojump = true; + list_opener = "copen"; + }; + }; + }; + + extraPackages = with pkgs; [ curl ]; + }; +} diff --git a/home/neovim/default.nix b/home/neovim/default.nix index d928a9e..c06f6e7 100644 --- a/home/neovim/default.nix +++ b/home/neovim/default.nix @@ -10,6 +10,7 @@ ./telescope.nix ./catppuccin.nix ./alpha.nix + ./avante.nix ]; programs.nixvim = {