Add KiCad, SPlayer, and fixed official OpenCode binary.

Replace broken nixpkgs opencode with upstream linux-x64 release to avoid SystemPrompt.environment crashes.
This commit is contained in:
WHC
2026-09-19 18:59:14 +08:00
parent 5a54a98c30
commit 12e5ec30af
3 changed files with 62 additions and 3 deletions
+50
View File
@@ -0,0 +1,50 @@
# 官方预编译二进制:nixpkgs 用新版 bun 构建的 opencode 会在发 prompt 时
# 触发 SystemPrompt.environment 崩溃(Unexpected server error / a.name)。
{
lib,
stdenv,
fetchurl,
autoPatchelfHook,
makeWrapper,
ripgrep,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "opencode";
version = "1.18.31";
src = fetchurl {
url = "https://github.com/anomalyco/opencode/releases/download/v${finalAttrs.version}/opencode-linux-x64.tar.gz";
hash = "sha256-6TEr517YA7dBX8Kuq9ofT+k4kSo5Zzdi3Aw4wOEeveQ=";
};
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
];
buildInputs = [ stdenv.cc.cc.lib ];
sourceRoot = ".";
dontStrip = true;
installPhase = ''
runHook preInstall
install -Dm755 opencode $out/bin/.opencode-wrapped
makeWrapper $out/bin/.opencode-wrapped $out/bin/opencode \
--prefix PATH : ${lib.makeBinPath [ ripgrep ]} \
--set OPENCODE_DISABLE_AUTOUPDATE true
runHook postInstall
'';
meta = {
description = "AI coding agent built for the terminal (official binary; nixpkgs build is broken)";
homepage = "https://github.com/anomalyco/opencode";
changelog = "https://github.com/anomalyco/opencode/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
platforms = [ "x86_64-linux" ];
mainProgram = "opencode";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
})