enable web search and claude auth in opencode
This commit is contained in:
+23
-2
@@ -47,12 +47,33 @@
|
|||||||
nodejs_24
|
nodejs_24
|
||||||
codex
|
codex
|
||||||
claude-code
|
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
|
winbox4
|
||||||
amdgpu_top
|
amdgpu_top
|
||||||
dua
|
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
|
# SSH config
|
||||||
programs.ssh = {
|
programs.ssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -95,4 +116,4 @@
|
|||||||
''
|
''
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
self: super:
|
self: super:
|
||||||
{
|
{
|
||||||
ddccontrol = super.callPackage ../pkgs/ddccontrol {};
|
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
|
# Pin some kde packages to 6.3.1, 6.3.2 breaks thunderbolt
|
||||||
# kdePackages = super.kdePackages.overrideScope(kdeFinal: kdePrev: {
|
# kdePackages = super.kdePackages.overrideScope(kdeFinal: kdePrev: {
|
||||||
# kwin = kdePrev.kwin.overrideAttrs (prevAttrs: {
|
# kwin = kdePrev.kwin.overrideAttrs (prevAttrs: {
|
||||||
|
|||||||
@@ -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/
|
||||||
|
'';
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user