opencode: fix anthropic again (use claude code creds)

This commit is contained in:
2026-03-20 14:33:58 -04:00
parent 1b810ada9d
commit 980a90ae04
4 changed files with 101 additions and 32 deletions

View File

@@ -110,6 +110,8 @@ let
# DNS things
dig
bun
];
in

View File

@@ -41,12 +41,27 @@ let
};
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;
opencode-claude-auth = pkgs.stdenv.mkDerivation {
pname = "opencode-claude-auth";
version = "0.5.7";
src = pkgs.fetchurl {
url = "https://registry.npmjs.org/opencode-claude-auth/-/opencode-claude-auth-0.5.7.tgz";
hash = "sha256-uGrh/hkXUCAL9m2fu6Tj0cPTvSOiY1ZEYT7m3ccHmrs=";
};
unpackPhase = ''
tar xzf $src
'';
installPhase = ''
mkdir -p $out
cp -r package/dist/* $out/
'';
};
in
{
home.packages = [
oh-my-opencode-pkg
pkgs.playwright-driver.browsers
inputs.claude-code.packages.${pkgs.stdenv.hostPlatform.system}.claude-code
];
home.sessionVariables = {
@@ -60,8 +75,8 @@ in
# 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/plugins/opencode-claude-auth".source = opencode-claude-auth;
xdg.configFile."opencode/skills/playwright.md".text =
let
@@ -178,6 +193,7 @@ in
autoshare = false;
autoupdate = false;
agent = { };
plugin = [ ];
provider = {
openrouter = {
models = {