opencode: fix opencode plugins and anthropic

This commit is contained in:
2026-03-19 23:40:51 -04:00
parent 73059edec7
commit b6aca41ff3
3 changed files with 34 additions and 5 deletions

View File

@@ -39,10 +39,13 @@ let
writing.model = "openrouter/google/gemini-3-flash-preview";
};
};
oh-my-opencode-pkg = inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.oh-my-opencode;
anthropic-user-agent-plugin = inputs.opencode-anthropic-user-agent-plugin;
in
{
home.packages = [
inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.oh-my-opencode
oh-my-opencode-pkg
pkgs.playwright-driver.browsers
];
@@ -53,6 +56,13 @@ in
xdg.configFile."opencode/oh-my-opencode.json".text = builtins.toJSON ohMyOpencodeConfig;
# Plugins are placed directly in the plugins directory so opencode
# auto-discovers them instead of downloading them from npm at runtime.
xdg.configFile."opencode/plugins/oh-my-opencode.js".source =
"${oh-my-opencode-pkg}/lib/oh-my-opencode/dist/index.js";
xdg.configFile."opencode/plugins/opencode-anthropic-user-agent-plugin.js".source =
"${anthropic-user-agent-plugin}/index.js";
xdg.configFile."opencode/skills/playwright.md".text =
let
browsers = pkgs.playwright-driver.browsers;
@@ -166,11 +176,8 @@ in
small_model = "openrouter/openai/gpt-oss-20b:free";
autoshare = false;
# note: this updates opencode (and plugins like oh-my-opencode) at launch,
# bypassing the version pinned in flake.lock
autoupdate = true;
autoupdate = false;
agent = { };
plugin = [ "oh-my-opencode" ];
provider = {
openrouter = {
models = {