enable web search and claude auth in opencode

This commit is contained in:
2026-04-19 03:15:41 +02:00
parent 1480bd94df
commit d860acb5d1
3 changed files with 42 additions and 2 deletions
+23 -2
View File
@@ -47,12 +47,33 @@
nodejs_24
codex
claude-code
opencode
(
# Wrapping opencode to set the OPENCODE_ENABLE_EXA environment variable
runCommand "opencode" {
buildInputs = [ makeWrapper ];
} ''
mkdir -p $out/bin
makeWrapper ${pkgs.opencode}/bin/opencode $out/bin/opencode \
--set OPENCODE_ENABLE_EXA "1"
''
)
winbox4
amdgpu_top
dua
];
# Inject the opencode-claude-auth plugin into the user's opencode.json without
# overwriting it — replaces any stale store path for this plugin and adds if absent.
home.activation.opencodeClaudeAuth = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
cfg="$HOME/.config/opencode/opencode.json"
mkdir -p "$(dirname "$cfg")"
[ -f "$cfg" ] || echo '{}' > "$cfg"
tmp=$(mktemp)
${pkgs.jq}/bin/jq --arg path "file://${pkgs.opencode-claude-auth}" '
.plugin = ((.plugin // []) | map(select(test("opencode-claude-auth") | not)) + [$path])
' "$cfg" > "$tmp" && mv "$tmp" "$cfg"
'';
# SSH config
programs.ssh = {
enable = true;
@@ -95,4 +116,4 @@
''
);
};
}
}
+1
View File
@@ -1,6 +1,7 @@
self: super:
{
ddccontrol = super.callPackage ../pkgs/ddccontrol {};
opencode-claude-auth = super.callPackage ../pkgs/opencode-claude-auth {};
# Pin some kde packages to 6.3.1, 6.3.2 breaks thunderbolt
# kdePackages = super.kdePackages.overrideScope(kdeFinal: kdePrev: {
# kwin = kdePrev.kwin.overrideAttrs (prevAttrs: {
+18
View File
@@ -0,0 +1,18 @@
{ stdenv, fetchurl }:
stdenv.mkDerivation {
pname = "opencode-claude-auth";
version = "1.5.0";
src = fetchurl {
url = "https://registry.npmjs.org/opencode-claude-auth/-/opencode-claude-auth-1.5.0.tgz";
hash = "sha512-5NSL+x++VTe2ZrFSznXKv7imiKObIBz0QXPuL+g1NAXAcdTGcbEbQBvvHZeIaSBNjmwpY2MR67Yez1f3LlPl7w==";
};
dontBuild = true;
installPhase = ''
mkdir -p $out
cp -r ./ $out/
'';
}