Sharing an overlay as workaround for the newly introduced opencode bug that has been raised since bun was version bumped.
Bug report: opencode: server error after sending prompt · Issue #563241 · NixOS/nixpkgs · GitHub
The overlay just rolls back the bun update for opencode while nixpkgs has no fix available.
opencode = let
bun_1_3_13 = prev.bun.overrideAttrs (old: rec {
version = "1.3.13";
src = prev.fetchurl {
url = "https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-${
{
"x86_64-linux" = "linux-x64-baseline";
"aarch64-linux" = "linux-aarch64";
"aarch64-darwin" = "darwin-aarch64";
}.${final.system}
}.zip";
hash = {
"x86_64-linux" = "sha256-nYokKSpwaAkCBdqsCloiP19pc29Sh+N7+I07QDHtx1A=";
"aarch64-linux" = "sha256-cLrkGzkIsKEg4eWMXIrzDnSvrjuNEbDT/djnh937SyI=";
"aarch64-darwin" = "sha256-VGfj9l26Umuf6pjwzOBO+vwMY+Fpcz7Ce4dqOtMtoZA=";
}.${final.system};
};
});
in inputs.nixpkgs-unstable.legacyPackages.${final.stdenv.hostPlatform.system}.opencode.override { bun = bun_1_3_13; };