Home/Nixinator: Add opencode
This commit is contained in:
@ -41,13 +41,38 @@
|
||||
args = ["-y" "@sveltejs/mcp"];
|
||||
type = "stdio";
|
||||
};
|
||||
# npx shadcn@latest mcp init --client claude
|
||||
shadcn = {
|
||||
# npx shadcn@latest mcp init --client claude
|
||||
command = "npx";
|
||||
args = ["-y" "shadcn@latest" "mcp"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
opencode = {
|
||||
enable = true;
|
||||
enableMcpIntegration = true;
|
||||
extraPackages = [
|
||||
# pkgs.opencode-claude-auth # Installed using npm
|
||||
];
|
||||
|
||||
# Writes opencode.json
|
||||
settings = {
|
||||
plugin = [
|
||||
# https://github.com/griffinmartin/opencode-claude-auth
|
||||
"opencode-claude-auth@latest"
|
||||
];
|
||||
};
|
||||
|
||||
# Writes tui.json
|
||||
tui = {};
|
||||
|
||||
agents = {};
|
||||
commands = {};
|
||||
context = '''';
|
||||
skills = {};
|
||||
tools = {};
|
||||
};
|
||||
};
|
||||
|
||||
home = let
|
||||
|
||||
@ -1112,6 +1112,7 @@ in {
|
||||
pkg = pkgs.vimPlugins.lualine-nvim;
|
||||
lazy = true;
|
||||
event = ["BufReadPost" "BufNewFile"];
|
||||
# dependencies = [opencode];
|
||||
config = ''
|
||||
function(_, opts)
|
||||
local lualine = require("lualine")
|
||||
@ -1211,6 +1212,7 @@ in {
|
||||
lualine_c.__raw = ''{}''; # Use __raw: Nixvim does nothing with "[]", so the default config would be used
|
||||
|
||||
lualine_x.__raw = ''{}'';
|
||||
# lualine_x.__raw = ''{ { require("opencode").statusline, }, }'';
|
||||
lualine_y = ["filetype" "encoding" "fileformat"];
|
||||
lualine_z.__raw = ''{ { "location", separator = {}, } }'';
|
||||
};
|
||||
@ -1450,6 +1452,22 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
# opencode = {
|
||||
# name = "opencode";
|
||||
# pkg = pkgs.vimPlugins.opencode-nvim;
|
||||
# lazy = false;
|
||||
# config = ''
|
||||
# function()
|
||||
# ---@type opencode.Opts
|
||||
# vim.g.opencode_opts = {
|
||||
# -- Your configuration, if any; goto definition on the type or field for details
|
||||
# }
|
||||
#
|
||||
# vim.o.autoread = true -- Required for `vim.g.opencode_opts.events.reload`
|
||||
# end
|
||||
# '';
|
||||
# };
|
||||
|
||||
# obsidian = rec {
|
||||
# name = "obsidian";
|
||||
# pkg = pkgs.vimPlugins.obsidian-nvim;
|
||||
@ -1674,7 +1692,7 @@ in {
|
||||
gitbrowse.enabled = false;
|
||||
image.enabled = false;
|
||||
indent.enabled = false;
|
||||
input.enabled = false;
|
||||
input.enabled = true;
|
||||
keymap.enabled = false;
|
||||
layout.enabled = false;
|
||||
lazygit.enabled = true;
|
||||
@ -1710,6 +1728,20 @@ in {
|
||||
truncate = 80;
|
||||
};
|
||||
};
|
||||
|
||||
actions = {
|
||||
opencode_send.__raw = ''
|
||||
function(picker)
|
||||
local items = vim.tbl_map(function(item)
|
||||
return item.file
|
||||
and require("opencode").format({ path = item.file, from = item.pos, to = item.end_pos })
|
||||
or item.text
|
||||
end, picker:selected({ fallback = true }))
|
||||
|
||||
require("opencode").prompt(table.concat(items, ", ") .. " ")
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
profiler.enabled = false;
|
||||
@ -2266,6 +2298,7 @@ in {
|
||||
noice # Modern UI overhaul, e.g. floating cmdline
|
||||
# obsidian # Integration with Obsidian.md
|
||||
|
||||
# opencode # TODO: Doesn't work, can't find "opencode --port" process
|
||||
# overseer # Run tasks from within neovim (e.g. cargo) # TODO:
|
||||
|
||||
persisted # Session management
|
||||
|
||||
@ -415,6 +415,52 @@ _: let
|
||||
}
|
||||
];
|
||||
|
||||
# leader-opencode = [
|
||||
# {
|
||||
# mode = "n";
|
||||
# key = "<leader>o";
|
||||
# action = "+opencode";
|
||||
# }
|
||||
# {
|
||||
# mode = ["n" "v"];
|
||||
# key = "<leader>oa";
|
||||
# action.__raw = ''function() require("opencode").ask("@this: ") end'';
|
||||
# options.desc = "Ask";
|
||||
# }
|
||||
# {
|
||||
# mode = ["n" "v"];
|
||||
# key = "<leader>os";
|
||||
# action.__raw = ''function() require("opencode").select() end'';
|
||||
# options.desc = "Select";
|
||||
# }
|
||||
# {
|
||||
# mode = "n";
|
||||
# key = "<leader>ol";
|
||||
# action.__raw = ''function() return require("opencode").operator("@this ") .. "_" end'';
|
||||
# options.desc = "Append Line";
|
||||
# options.expr = true;
|
||||
# }
|
||||
# {
|
||||
# mode = ["n" "v"];
|
||||
# key = "<leader>or";
|
||||
# action.__raw = ''function() return require("opencode").operator("@this ") end'';
|
||||
# options.desc = "Append Range";
|
||||
# options.expr = true;
|
||||
# }
|
||||
# {
|
||||
# mode = "n";
|
||||
# key = "<S-C-u>";
|
||||
# action.__raw = ''function() require("opencode").command("session.half.page.up") end'';
|
||||
# options.desc = "Scroll OpenCode Up";
|
||||
# }
|
||||
# {
|
||||
# mode = "n";
|
||||
# key = "<S-C-d>";
|
||||
# action.__raw = ''function() require("opencode").command("session.half.page.down") end'';
|
||||
# options.desc = "Scroll OpenCode Down";
|
||||
# }
|
||||
# ];
|
||||
|
||||
leader-file = [
|
||||
{
|
||||
mode = "n";
|
||||
@ -1005,6 +1051,7 @@ in
|
||||
no-leader
|
||||
|
||||
leader
|
||||
# leader-opencode
|
||||
leader-file
|
||||
leader-help
|
||||
leader-quit
|
||||
|
||||
@ -170,10 +170,13 @@ in {
|
||||
codex-acp = {
|
||||
type = "registry";
|
||||
};
|
||||
gemini = {
|
||||
type = "registry";
|
||||
};
|
||||
mistral-vibe = {
|
||||
type = "registry";
|
||||
};
|
||||
gemini = {
|
||||
opencode = {
|
||||
type = "registry";
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user