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

104
flake.lock generated
View File

@@ -59,6 +59,25 @@
"type": "github"
}
},
"claude-code": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1773961521,
"narHash": "sha256-enhjd1AcHHU+3RCRdSWVQj6TIqRXkJUbQSFVXzC6xLo=",
"owner": "sadjow",
"repo": "claude-code-nix",
"rev": "1519be1f77ed017ae4a88916ac54529cef885573",
"type": "github"
},
"original": {
"owner": "sadjow",
"repo": "claude-code-nix",
"type": "github"
}
},
"crane": {
"locked": {
"lastModified": 1772080396,
@@ -211,7 +230,25 @@
},
"flake-utils": {
"inputs": {
"systems": "systems_2"
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1710146030,
@@ -330,7 +367,7 @@
},
"json2steamshortcut": {
"inputs": {
"flake-utils": "flake-utils",
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
@@ -382,7 +419,7 @@
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_3",
"systems": "systems_4",
"treefmt-nix": "treefmt-nix"
},
"locked": {
@@ -468,7 +505,7 @@
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_4"
"systems": "systems_5"
},
"locked": {
"lastModified": 1773911054,
@@ -538,6 +575,22 @@
}
},
"nixpkgs": {
"locked": {
"lastModified": 1773628058,
"narHash": "sha256-hpXH0z3K9xv0fHaje136KY872VT2T5uwxtezlAskQgY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f8573b9c935cfaa162dd62cc9e75ae2db86f85df",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1773821835,
"narHash": "sha256-TJ3lSQtW0E2JrznGVm8hOQGVpXjJyXY2guAxku2O9A4=",
@@ -553,7 +606,7 @@
"type": "github"
}
},
"nixpkgs_2": {
"nixpkgs_3": {
"locked": {
"lastModified": 1770107345,
"narHash": "sha256-tbS0Ebx2PiA1FRW8mt8oejR0qMXmziJmPaU1d4kYY9g=",
@@ -596,7 +649,7 @@
"noctalia",
"nixpkgs"
],
"systems": "systems_5",
"systems": "systems_6",
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
@@ -613,22 +666,6 @@
"type": "github"
}
},
"opencode-anthropic-user-agent-plugin": {
"flake": false,
"locked": {
"lastModified": 1774011798,
"narHash": "sha256-GdZK4wi+oNFjdM5pdGAJ6GCxWfZM3J86hq8DcqNp8hg=",
"owner": "dotCipher",
"repo": "opencode-anthropic-user-agent-plugin",
"rev": "f93bb1dfb744496335917391b6e37c34a9a81e7a",
"type": "github"
},
"original": {
"owner": "dotCipher",
"repo": "opencode-anthropic-user-agent-plugin",
"type": "github"
}
},
"pre-commit": {
"inputs": {
"flake-compat": "flake-compat_2",
@@ -654,6 +691,7 @@
},
"root": {
"inputs": {
"claude-code": "claude-code",
"deploy-rs": "deploy-rs",
"disko": "disko",
"emacs-overlay": "emacs-overlay",
@@ -667,9 +705,8 @@
"nix-doom-emacs-unstraightened": "nix-doom-emacs-unstraightened",
"nix-flatpak": "nix-flatpak",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixpkgs": "nixpkgs_2",
"noctalia": "noctalia",
"opencode-anthropic-user-agent-plugin": "opencode-anthropic-user-agent-plugin",
"rust-overlay": "rust-overlay",
"zen-browser": "zen-browser"
}
@@ -755,6 +792,21 @@
}
},
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_6": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
@@ -792,7 +844,7 @@
},
"treefmt-nix_2": {
"inputs": {
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1772660329,
@@ -810,7 +862,7 @@
},
"utils": {
"inputs": {
"systems": "systems"
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,

View File

@@ -84,9 +84,8 @@
inputs.nixpkgs.follows = "nixpkgs";
};
opencode-anthropic-user-agent-plugin = {
url = "github:dotCipher/opencode-anthropic-user-agent-plugin";
flake = false;
claude-code = {
url = "github:sadjow/claude-code-nix";
};
};

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 = {