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

17
flake.lock generated
View File

@@ -613,6 +613,22 @@
"type": "github" "type": "github"
} }
}, },
"opencode-anthropic-user-agent-plugin": {
"flake": false,
"locked": {
"lastModified": 1773977067,
"narHash": "sha256-KUW3npBSvCYU5kEULmNI0MLBf6r6DFH1DUKNKNmul9Q=",
"owner": "dotCipher",
"repo": "opencode-anthropic-user-agent-plugin",
"rev": "5981826955f0429583ad8a5a25fd2909d292d882",
"type": "github"
},
"original": {
"owner": "dotCipher",
"repo": "opencode-anthropic-user-agent-plugin",
"type": "github"
}
},
"pre-commit": { "pre-commit": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
@@ -653,6 +669,7 @@
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"noctalia": "noctalia", "noctalia": "noctalia",
"opencode-anthropic-user-agent-plugin": "opencode-anthropic-user-agent-plugin",
"rust-overlay": "rust-overlay", "rust-overlay": "rust-overlay",
"zen-browser": "zen-browser" "zen-browser": "zen-browser"
} }

View File

@@ -83,6 +83,11 @@
url = "github:ChrisOboe/json2steamshortcut"; url = "github:ChrisOboe/json2steamshortcut";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
opencode-anthropic-user-agent-plugin = {
url = "github:dotCipher/opencode-anthropic-user-agent-plugin";
flake = false;
};
}; };
outputs = outputs =

View File

@@ -39,10 +39,13 @@ let
writing.model = "openrouter/google/gemini-3-flash-preview"; 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 in
{ {
home.packages = [ home.packages = [
inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.oh-my-opencode oh-my-opencode-pkg
pkgs.playwright-driver.browsers pkgs.playwright-driver.browsers
]; ];
@@ -53,6 +56,13 @@ in
xdg.configFile."opencode/oh-my-opencode.json".text = builtins.toJSON ohMyOpencodeConfig; 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 = xdg.configFile."opencode/skills/playwright.md".text =
let let
browsers = pkgs.playwright-driver.browsers; browsers = pkgs.playwright-driver.browsers;
@@ -166,11 +176,8 @@ in
small_model = "openrouter/openai/gpt-oss-20b:free"; small_model = "openrouter/openai/gpt-oss-20b:free";
autoshare = false; autoshare = false;
# note: this updates opencode (and plugins like oh-my-opencode) at launch, autoupdate = false;
# bypassing the version pinned in flake.lock
autoupdate = true;
agent = { }; agent = { };
plugin = [ "oh-my-opencode" ];
provider = { provider = {
openrouter = { openrouter = {
models = { models = {