diff --git a/plugins/by-name/sidekick/default.nix b/plugins/by-name/sidekick/default.nix new file mode 100644 index 00000000..884fe33c --- /dev/null +++ b/plugins/by-name/sidekick/default.nix @@ -0,0 +1,35 @@ +{ + lib, + config, + options, + ... +}: +lib.nixvim.plugins.mkNeovimPlugin { + name = "sidekick"; + package = "sidekick-nvim"; + + maintainers = [ lib.maintainers.khaneliman ]; + + dependencies = [ + "claude-code" + "copilot" + "gemini" + "opencode" + ]; + + extraConfig = { + assertions = lib.nixvim.mkAssertions "plugins.sidekick" { + assertion = config.plugins.copilot-lua.enable || config.lsp.servers.copilot.enable; + message = "sidekick requires either copilot-lua (${options.plugins.copilot-lua.enable}) or copilot LSP (${options.lsp.servers}.copilot.enable) to be enabled"; + }; + }; + + settingsExample = { + cli = { + mux = { + backend = "zellij"; + enabled = true; + }; + }; + }; +} diff --git a/tests/test-sources/plugins/by-name/sidekick/default.nix b/tests/test-sources/plugins/by-name/sidekick/default.nix new file mode 100644 index 00000000..062bc1ce --- /dev/null +++ b/tests/test-sources/plugins/by-name/sidekick/default.nix @@ -0,0 +1,169 @@ +{ + empty = { + plugins.copilot-lua.enable = true; + plugins.sidekick.enable = true; + }; + + defaults = { + plugins.copilot-lua.enable = true; + plugins.sidekick = { + enable = true; + settings = { + jump = { + jumplist = true; + }; + signs = { + enabled = true; + icon = " "; + }; + nes = { + enabled.__raw = '' + function(buf) + return vim.g.sidekick_nes ~= false and vim.b.sidekick_nes ~= false + end''; + debounce = 100; + trigger = { + events = [ + "InsertLeave" + "TextChanged" + "User SidekickNesDone" + ]; + }; + clear = { + events = [ + "TextChangedI" + "BufWritePre" + "InsertEnter" + ]; + esc = true; + }; + diff = { + inline = "words"; + }; + }; + cli = { + watch = true; + win = { + wo = { }; + bo = { }; + width = 80; + height = 20; + layout = "vertical"; + position = "right"; + keys = { + stopinsert = [ + "" + "stopinsert" + { mode = "t"; } + ]; + hide_n = [ + "q" + "hide" + { mode = "n"; } + ]; + hide_t = [ + "" + "hide" + ]; + win_p = [ + "p" + "blur" + ]; + blur = [ + "" + "blur" + ]; + prompt = [ + "" + "prompt" + ]; + }; + }; + }; + mux = { + backend = "zellij"; + enabled = false; + }; + tools = { + aider = { + cmd = [ "aider" ]; + url = "https://github.com/Aider-AI/aider"; + }; + amazon_q = { + cmd = [ "q" ]; + url = "https://github.com/aws/amazon-q-developer-cli"; + }; + claude = { + cmd = [ "claude" ]; + url = "https://github.com/anthropics/claude-code"; + }; + codex = { + cmd = [ + "codex" + "--search" + ]; + url = "https://github.com/openai/codex"; + }; + copilot = { + cmd = [ + "copilot" + "--banner" + ]; + url = "https://github.com/github/copilot-cli"; + }; + cursor = { + cmd = [ "cursor-agent" ]; + url = "https://cursor.com/cli"; + }; + gemini = { + cmd = [ "gemini" ]; + url = "https://github.com/google-gemini/gemini-cli"; + }; + grok = { + cmd = [ "grok" ]; + url = "https://github.com/superagent-ai/grok-cli"; + }; + opencode = { + cmd = [ "opencode" ]; + url = "https://github.com/sst/opencode"; + }; + qwen = { + cmd = [ "qwen" ]; + url = "https://github.com/QwenLM/qwen-code"; + }; + }; + prompts = { + explain = "Explain this code"; + diagnostics = { + msg = "What do the diagnostics in this file mean?"; + diagnostics = true; + }; + diagnostics_all = { + msg = "Can you help me fix these issues?"; + diagnostics = { + all = true; + }; + }; + fix = { + msg = "Can you fix the issues in this code?"; + diagnostics = true; + }; + review = { + msg = "Can you review this code for any issues or improvements?"; + diagnostics = true; + }; + optimize = "How can this code be optimized?"; + tests = "Can you write tests for this code?"; + file = { + location = { + row = false; + col = false; + }; + position = { }; + }; + }; + debug = false; + }; + }; + }; +}