Home/Nixinator: Add opencode
This commit is contained in:
@ -41,13 +41,38 @@
|
|||||||
args = ["-y" "@sveltejs/mcp"];
|
args = ["-y" "@sveltejs/mcp"];
|
||||||
type = "stdio";
|
type = "stdio";
|
||||||
};
|
};
|
||||||
# npx shadcn@latest mcp init --client claude
|
|
||||||
shadcn = {
|
shadcn = {
|
||||||
|
# npx shadcn@latest mcp init --client claude
|
||||||
command = "npx";
|
command = "npx";
|
||||||
args = ["-y" "shadcn@latest" "mcp"];
|
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
|
home = let
|
||||||
|
|||||||
@ -1112,6 +1112,7 @@ in {
|
|||||||
pkg = pkgs.vimPlugins.lualine-nvim;
|
pkg = pkgs.vimPlugins.lualine-nvim;
|
||||||
lazy = true;
|
lazy = true;
|
||||||
event = ["BufReadPost" "BufNewFile"];
|
event = ["BufReadPost" "BufNewFile"];
|
||||||
|
# dependencies = [opencode];
|
||||||
config = ''
|
config = ''
|
||||||
function(_, opts)
|
function(_, opts)
|
||||||
local lualine = require("lualine")
|
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_c.__raw = ''{}''; # Use __raw: Nixvim does nothing with "[]", so the default config would be used
|
||||||
|
|
||||||
lualine_x.__raw = ''{}'';
|
lualine_x.__raw = ''{}'';
|
||||||
|
# lualine_x.__raw = ''{ { require("opencode").statusline, }, }'';
|
||||||
lualine_y = ["filetype" "encoding" "fileformat"];
|
lualine_y = ["filetype" "encoding" "fileformat"];
|
||||||
lualine_z.__raw = ''{ { "location", separator = {}, } }'';
|
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 {
|
# obsidian = rec {
|
||||||
# name = "obsidian";
|
# name = "obsidian";
|
||||||
# pkg = pkgs.vimPlugins.obsidian-nvim;
|
# pkg = pkgs.vimPlugins.obsidian-nvim;
|
||||||
@ -1674,7 +1692,7 @@ in {
|
|||||||
gitbrowse.enabled = false;
|
gitbrowse.enabled = false;
|
||||||
image.enabled = false;
|
image.enabled = false;
|
||||||
indent.enabled = false;
|
indent.enabled = false;
|
||||||
input.enabled = false;
|
input.enabled = true;
|
||||||
keymap.enabled = false;
|
keymap.enabled = false;
|
||||||
layout.enabled = false;
|
layout.enabled = false;
|
||||||
lazygit.enabled = true;
|
lazygit.enabled = true;
|
||||||
@ -1710,6 +1728,20 @@ in {
|
|||||||
truncate = 80;
|
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;
|
profiler.enabled = false;
|
||||||
@ -2266,6 +2298,7 @@ in {
|
|||||||
noice # Modern UI overhaul, e.g. floating cmdline
|
noice # Modern UI overhaul, e.g. floating cmdline
|
||||||
# obsidian # Integration with Obsidian.md
|
# 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:
|
# overseer # Run tasks from within neovim (e.g. cargo) # TODO:
|
||||||
|
|
||||||
persisted # Session management
|
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 = [
|
leader-file = [
|
||||||
{
|
{
|
||||||
mode = "n";
|
mode = "n";
|
||||||
@ -1005,6 +1051,7 @@ in
|
|||||||
no-leader
|
no-leader
|
||||||
|
|
||||||
leader
|
leader
|
||||||
|
# leader-opencode
|
||||||
leader-file
|
leader-file
|
||||||
leader-help
|
leader-help
|
||||||
leader-quit
|
leader-quit
|
||||||
|
|||||||
@ -170,10 +170,13 @@ in {
|
|||||||
codex-acp = {
|
codex-acp = {
|
||||||
type = "registry";
|
type = "registry";
|
||||||
};
|
};
|
||||||
|
gemini = {
|
||||||
|
type = "registry";
|
||||||
|
};
|
||||||
mistral-vibe = {
|
mistral-vibe = {
|
||||||
type = "registry";
|
type = "registry";
|
||||||
};
|
};
|
||||||
gemini = {
|
opencode = {
|
||||||
type = "registry";
|
type = "registry";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user