Hash mismatch when using opencode flake.nix #2975

Closed
opened 2026-02-16 17:38:06 -05:00 by yindo · 18 comments
Owner

Originally created by @Cody-W-Tucker on GitHub (Nov 19, 2025).

Description

There's a script that should update the hash, but the node_modules hash doesn't match what's expected.

Is the update script included in the build commands?

OpenCode version

dev

Steps to reproduce

Install like this:

Flake.nix: inputs.opencode.url = "github:sst/opencode";
home-manager: inputs.opencode.packages.${system}.default

Run nixos-rebuild switch

See error:

error: hash mismatch in fixed-output derivation '/nix/store/m38y76z7ghgh0gjhvh2cildvkxzdlpqx-opencode-node_modules-1.0.78.drv':

specified: sha256-Z3GTCHOVaBW79tx2rSkKOCHlZRPiTD6h9pdIDD12kxU=
got: sha256-hscyqeQXQ6QxXZ4Oh/YwMUkbV+loj2qR8/TcmAlK70c=

Screenshot and/or share link

No response

Operating System

Linux (NixOS)

Terminal

Kitty

Originally created by @Cody-W-Tucker on GitHub (Nov 19, 2025). ### Description There's a script that should update the hash, but the node_modules hash doesn't match what's expected. Is the update script included in the build commands? ### OpenCode version dev ### Steps to reproduce Install like this: Flake.nix: `inputs.opencode.url = "github:sst/opencode";` home-manager: `inputs.opencode.packages.${system}.default` Run `nixos-rebuild switch` See error: error: `hash mismatch in fixed-output derivation '/nix/store/m38y76z7ghgh0gjhvh2cildvkxzdlpqx-opencode-node_modules-1.0.78.drv':` `specified: sha256-Z3GTCHOVaBW79tx2rSkKOCHlZRPiTD6h9pdIDD12kxU=` `got: sha256-hscyqeQXQ6QxXZ4Oh/YwMUkbV+loj2qR8/TcmAlK70c=` ### Screenshot and/or share link _No response_ ### Operating System Linux (NixOS) ### Terminal Kitty
yindo added the bugnix labels 2026-02-16 17:38:06 -05:00
yindo closed this issue 2026-02-16 17:38:06 -05:00
Author
Owner

@ndrwstn commented on GitHub (Nov 19, 2025):

For the moment, try nix run sst/opencode. I'm having the same problem, but run builds it correctly (for me), which then allows the flake to use the already-build nix store.

@ndrwstn commented on GitHub (Nov 19, 2025): For the moment, try `nix run sst/opencode`. I'm having the same problem, but run builds it correctly (for me), which then allows the flake to use the already-build nix store.
Author
Owner

@bogorad commented on GitHub (Nov 19, 2025):

which platform? for me it works on amd64-linux, fails on aarch64-linux.

@bogorad commented on GitHub (Nov 19, 2025): which platform? for me it works on `amd64-linux`, fails on `aarch64-linux`.
Author
Owner

@Cody-W-Tucker commented on GitHub (Nov 19, 2025):

which platform? for me it works on amd64-linux, fails on aarch64-linux.

x86_64-linux

For the moment, try nix run sst/opencode. I'm having the same problem, but run builds it correctly (for me), which then allows the flake to use the already-build nix store.

I'll try that and update here

@Cody-W-Tucker commented on GitHub (Nov 19, 2025): > which platform? for me it works on `amd64-linux`, fails on `aarch64-linux`. x86_64-linux > For the moment, try `nix run sst/opencode`. I'm having the same problem, but run builds it correctly (for me), which then allows the flake to use the already-build nix store. I'll try that and update here
Author
Owner

@bogorad commented on GitHub (Nov 19, 2025):

just in case, my config:

in inputs (does not follow packages):

opencode-flake.url = "github:sst/opencode";

then, in host config (not in home-manager):

  environment.systemPackages = [
              inputs.opencode-flake.packages.${pkgs.system}.default
]
@bogorad commented on GitHub (Nov 19, 2025): just in case, my config: in inputs (does not follow packages): `opencode-flake.url = "github:sst/opencode";` then, in host config (not in home-manager): ``` environment.systemPackages = [ inputs.opencode-flake.packages.${pkgs.system}.default ]
Author
Owner

@Cody-W-Tucker commented on GitHub (Nov 20, 2025):

Rebuilt with the new hashes provided by #4535 and worked with no issues.

Thanks @Alb-O

@Cody-W-Tucker commented on GitHub (Nov 20, 2025): Rebuilt with the new hashes provided by #4535 and worked with no issues. Thanks @Alb-O
Author
Owner

@aashish2057 commented on GitHub (Nov 20, 2025):

Did the hash update work with 1.0.80? Having issues where when I upgrade to 1.0.80, can't launch opencode anymore or even run opencode --version outputs nothing. 1.0.78 works perfectly though.

@aashish2057 commented on GitHub (Nov 20, 2025): Did the hash update work with 1.0.80? Having issues where when I upgrade to 1.0.80, can't launch opencode anymore or even run opencode --version outputs nothing. 1.0.78 works perfectly though.
Author
Owner

@aashish2057 commented on GitHub (Nov 20, 2025):

Have same issue if I just run nix run github:sst/opencode

@aashish2057 commented on GitHub (Nov 20, 2025): Have same issue if I just run `nix run github:sst/opencode`
Author
Owner

@Cody-W-Tucker commented on GitHub (Nov 20, 2025):

Did the hash update work with 1.0.80? Having issues where when I upgrade to 1.0.80, can't launch opencode anymore or even run opencode --version outputs nothing. 1.0.78 works perfectly though.

yes for me it worked. Are you on x86_64-linux?

It's important to use the nixpkgs that they ship, so in your flake: inputs.opencode.url = "github:sst/opencode"; with no follows. Then you can ensure you have the same node_modules.

If you'd like, I can reopen the issue if you're still having the hash mismatch.

@Cody-W-Tucker commented on GitHub (Nov 20, 2025): > Did the hash update work with 1.0.80? Having issues where when I upgrade to 1.0.80, can't launch opencode anymore or even run opencode --version outputs nothing. 1.0.78 works perfectly though. yes for me it worked. Are you on x86_64-linux? It's important to use the nixpkgs that they ship, so in your flake: `inputs.opencode.url = "github:sst/opencode";` with no follows. Then you can ensure you have the same node_modules. If you'd like, I can reopen the issue if you're still having the hash mismatch.
Author
Owner

@aashish2057 commented on GitHub (Nov 20, 2025):

No I am on aarch64-darwin, and yeah I am not using follow nixpkgs. I should also be able to just run the flake as standalone and that doesn't seem to work either.

I am not sure if it is a hash issue, don't see any error message.

@aashish2057 commented on GitHub (Nov 20, 2025): No I am on aarch64-darwin, and yeah I am not using follow nixpkgs. I should also be able to just run the flake as standalone and that doesn't seem to work either. I am not sure if it is a hash issue, don't see any error message.
Author
Owner

@bogorad commented on GitHub (Nov 20, 2025):

try

nix run github:sst/opencode --refresh -L

@bogorad commented on GitHub (Nov 20, 2025): try `nix run github:sst/opencode --refresh -L`
Author
Owner

@bogorad commented on GitHub (Nov 20, 2025):

I just checked after the version bump to .81 - both amd64 and aarch64 rebuilt with no errors.

@bogorad commented on GitHub (Nov 20, 2025): I just checked after the version bump to .81 - both amd64 and aarch64 rebuilt with no errors.
Author
Owner

@aashish2057 commented on GitHub (Nov 20, 2025):

This should put me in the TUI right? It doesn't nothing happens after this?

nix run github:sst/opencode --refresh -L
opencode-node_modules> Running phase: unpackPhase
opencode-node_modules> unpacking source archive /nix/store/9mwb9spdabxil6vigvpdn7yryfd5zm40-l34v3x8mc398bl5892v8id8xqj9vanv8-source
opencode-node_modules> source root is l34v3x8mc398bl5892v8id8xqj9vanv8-source
opencode-node_modules> Running phase: patchPhase
opencode-node_modules> Running phase: updateAutotoolsGnuConfigScriptsPhase
opencode-node_modules> Running phase: buildPhase
opencode-node_modules> bun install v1.3.2 (b131639c)
opencode-node_modules> Resolving dependencies
opencode-node_modules> Resolved, downloaded and extracted [247]
opencode-node_modules>
opencode-node_modules> + @tsconfig/bun@1.0.9 (v1.0.10 available)
opencode-node_modules> + husky@9.1.7
opencode-node_modules> + prettier@3.6.2
opencode-node_modules> + sst@3.17.23
opencode-node_modules> + turbo@2.5.6
opencode-node_modules>
opencode-node_modules> 3755 packages installed [25.68s]
opencode-node_modules> [canonicalize-node-modules] rebuilt 1565 links
opencode-node_modules>    @actions/core -> ../../@actions+core@1.11.1/node_modules/@actions/core
opencode-node_modules>    @actions/exec -> ../../@actions+exec@1.1.1/node_modules/@actions/exec
opencode-node_modules>    @actions/github -> ../../@actions+github@6.0.1/node_modules/@actions/github
opencode-node_modules>    @actions/http-client -> ../../@actions+http-client@2.2.3/node_modules/@actions/http-client
opencode-node_modules>    @actions/io -> ../../@actions+io@1.1.3/node_modules/@actions/io
opencode-node_modules>    @adobe/css-tools -> ../../@adobe+css-tools@4.4.4/node_modules/@adobe/css-tools
opencode-node_modules>    @agentclientprotocol/sdk -> ../../@agentclientprotocol+sdk@0.5.1/node_modules/@agentclientprotocol/sdk
opencode-node_modules>    @ai-sdk/amazon-bedrock -> ../../@ai-sdk+amazon-bedrock@2.2.10+d6123d32214422cb/node_modules/@ai-sdk/amazon-bedrock
opencode-node_modules>    @ai-sdk/anthropic -> ../../@ai-sdk+anthropic@2.0.9+d6123d32214422cb/node_modules/@ai-sdk/anthropic
opencode-node_modules>    @ai-sdk/gateway -> ../../@ai-sdk+gateway@2.0.12+d6123d32214422cb/node_modules/@ai-sdk/gateway
opencode-node_modules>    @ai-sdk/google -> ../../@ai-sdk+google@2.0.11+d6123d32214422cb/node_modules/@ai-sdk/google
opencode-node_modules>    @ai-sdk/google-vertex -> ../../@ai-sdk+google-vertex@3.0.16+d6123d32214422cb/node_modules/@ai-sdk/google-vertex
opencode-node_modules>    @ai-sdk/mcp -> ../../@ai-sdk+mcp@0.0.8+d6123d32214422cb/node_modules/@ai-sdk/mcp
opencode-node_modules>    @ai-sdk/openai -> ../../@ai-sdk+openai@2.0.2+d6123d32214422cb/node_modules/@ai-sdk/openai
opencode-node_modules>    @ai-sdk/openai-compatible -> ../../@ai-sdk+openai-compatible@1.0.1+d6123d32214422cb/node_modules/@ai-sdk/openai-compatible
opencode-node_modules>    @ai-sdk/provider -> ../../@ai-sdk+provider@2.0.0/node_modules/@ai-sdk/provider
opencode-node_modules>    @ai-sdk/provider-utils -> ../../@ai-sdk+provider-utils@3.0.17+d6123d32214422cb/node_modules/@ai-sdk/provider-utils
opencode-node_modules>    @alloc/quick-lru -> ../../@alloc+quick-lru@5.2.0/node_modules/@alloc/quick-lru
opencode-node_modules>    @ampproject/remapping -> ../../@ampproject+remapping@2.3.0/node_modules/@ampproject/remapping
opencode-node_modules>    @astrojs/cloudflare -> ../../@astrojs+cloudflare@12.6.3+0ce71ba4204a51e0/node_modules/@astrojs/cloudflare
opencode-node_modules>   ...
opencode-node_modules> [normalize-bun-binaries] rewrote 118 links
opencode-node_modules> Running phase: installPhase
opencode> Running phase: unpackPhase
opencode> unpacking source archive /nix/store/9mwb9spdabxil6vigvpdn7yryfd5zm40-l34v3x8mc398bl5892v8id8xqj9vanv8-source
opencode> source root is l34v3x8mc398bl5892v8id8xqj9vanv8-source
opencode> Running phase: patchPhase
opencode> Running phase: updateAutotoolsGnuConfigScriptsPhase
opencode> Running phase: configurePhase
opencode> Running phase: buildPhase
opencode> substituteStream() in derivation opencode-1.0.81: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. (file 'bun-build.ts')
opencode> Build successful!
opencode> Running phase: installPhase
opencode> Running phase: fixupPhase
opencode> checking for references to /nix/var/nix/builds/nix-76904-3308273629/ in /nix/store/89l8iw33q0585hh8hzkqvlm439f0iiff-opencode-1.0.81...
opencode> patching script interpreter paths in /nix/store/89l8iw33q0585hh8hzkqvlm439f0iiff-opencode-1.0.81
@aashish2057 commented on GitHub (Nov 20, 2025): This should put me in the TUI right? It doesn't nothing happens after this? ``` nix run github:sst/opencode --refresh -L opencode-node_modules> Running phase: unpackPhase opencode-node_modules> unpacking source archive /nix/store/9mwb9spdabxil6vigvpdn7yryfd5zm40-l34v3x8mc398bl5892v8id8xqj9vanv8-source opencode-node_modules> source root is l34v3x8mc398bl5892v8id8xqj9vanv8-source opencode-node_modules> Running phase: patchPhase opencode-node_modules> Running phase: updateAutotoolsGnuConfigScriptsPhase opencode-node_modules> Running phase: buildPhase opencode-node_modules> bun install v1.3.2 (b131639c) opencode-node_modules> Resolving dependencies opencode-node_modules> Resolved, downloaded and extracted [247] opencode-node_modules> opencode-node_modules> + @tsconfig/bun@1.0.9 (v1.0.10 available) opencode-node_modules> + husky@9.1.7 opencode-node_modules> + prettier@3.6.2 opencode-node_modules> + sst@3.17.23 opencode-node_modules> + turbo@2.5.6 opencode-node_modules> opencode-node_modules> 3755 packages installed [25.68s] opencode-node_modules> [canonicalize-node-modules] rebuilt 1565 links opencode-node_modules> @actions/core -> ../../@actions+core@1.11.1/node_modules/@actions/core opencode-node_modules> @actions/exec -> ../../@actions+exec@1.1.1/node_modules/@actions/exec opencode-node_modules> @actions/github -> ../../@actions+github@6.0.1/node_modules/@actions/github opencode-node_modules> @actions/http-client -> ../../@actions+http-client@2.2.3/node_modules/@actions/http-client opencode-node_modules> @actions/io -> ../../@actions+io@1.1.3/node_modules/@actions/io opencode-node_modules> @adobe/css-tools -> ../../@adobe+css-tools@4.4.4/node_modules/@adobe/css-tools opencode-node_modules> @agentclientprotocol/sdk -> ../../@agentclientprotocol+sdk@0.5.1/node_modules/@agentclientprotocol/sdk opencode-node_modules> @ai-sdk/amazon-bedrock -> ../../@ai-sdk+amazon-bedrock@2.2.10+d6123d32214422cb/node_modules/@ai-sdk/amazon-bedrock opencode-node_modules> @ai-sdk/anthropic -> ../../@ai-sdk+anthropic@2.0.9+d6123d32214422cb/node_modules/@ai-sdk/anthropic opencode-node_modules> @ai-sdk/gateway -> ../../@ai-sdk+gateway@2.0.12+d6123d32214422cb/node_modules/@ai-sdk/gateway opencode-node_modules> @ai-sdk/google -> ../../@ai-sdk+google@2.0.11+d6123d32214422cb/node_modules/@ai-sdk/google opencode-node_modules> @ai-sdk/google-vertex -> ../../@ai-sdk+google-vertex@3.0.16+d6123d32214422cb/node_modules/@ai-sdk/google-vertex opencode-node_modules> @ai-sdk/mcp -> ../../@ai-sdk+mcp@0.0.8+d6123d32214422cb/node_modules/@ai-sdk/mcp opencode-node_modules> @ai-sdk/openai -> ../../@ai-sdk+openai@2.0.2+d6123d32214422cb/node_modules/@ai-sdk/openai opencode-node_modules> @ai-sdk/openai-compatible -> ../../@ai-sdk+openai-compatible@1.0.1+d6123d32214422cb/node_modules/@ai-sdk/openai-compatible opencode-node_modules> @ai-sdk/provider -> ../../@ai-sdk+provider@2.0.0/node_modules/@ai-sdk/provider opencode-node_modules> @ai-sdk/provider-utils -> ../../@ai-sdk+provider-utils@3.0.17+d6123d32214422cb/node_modules/@ai-sdk/provider-utils opencode-node_modules> @alloc/quick-lru -> ../../@alloc+quick-lru@5.2.0/node_modules/@alloc/quick-lru opencode-node_modules> @ampproject/remapping -> ../../@ampproject+remapping@2.3.0/node_modules/@ampproject/remapping opencode-node_modules> @astrojs/cloudflare -> ../../@astrojs+cloudflare@12.6.3+0ce71ba4204a51e0/node_modules/@astrojs/cloudflare opencode-node_modules> ... opencode-node_modules> [normalize-bun-binaries] rewrote 118 links opencode-node_modules> Running phase: installPhase opencode> Running phase: unpackPhase opencode> unpacking source archive /nix/store/9mwb9spdabxil6vigvpdn7yryfd5zm40-l34v3x8mc398bl5892v8id8xqj9vanv8-source opencode> source root is l34v3x8mc398bl5892v8id8xqj9vanv8-source opencode> Running phase: patchPhase opencode> Running phase: updateAutotoolsGnuConfigScriptsPhase opencode> Running phase: configurePhase opencode> Running phase: buildPhase opencode> substituteStream() in derivation opencode-1.0.81: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. (file 'bun-build.ts') opencode> Build successful! opencode> Running phase: installPhase opencode> Running phase: fixupPhase opencode> checking for references to /nix/var/nix/builds/nix-76904-3308273629/ in /nix/store/89l8iw33q0585hh8hzkqvlm439f0iiff-opencode-1.0.81... opencode> patching script interpreter paths in /nix/store/89l8iw33q0585hh8hzkqvlm439f0iiff-opencode-1.0.81 ```
Author
Owner

@aashish2057 commented on GitHub (Nov 20, 2025):

nix run github:sst/opencode/v1.0.78 runs fine for me

@aashish2057 commented on GitHub (Nov 20, 2025): `nix run github:sst/opencode/v1.0.78` runs fine for me
Author
Owner

@bogorad commented on GitHub (Nov 20, 2025):

just tried it with the current (1.0.81) version on amd64 and aarch64 - works.

@bogorad commented on GitHub (Nov 20, 2025): just tried it with the current (1.0.81) version on amd64 and aarch64 - works.
Author
Owner

@aashish2057 commented on GitHub (Nov 20, 2025):

darwin or linux?

@aashish2057 commented on GitHub (Nov 20, 2025): darwin or linux?
Author
Owner

@bogorad commented on GitHub (Nov 20, 2025):

darwin or linux?

Linux (nixos, in Qemu, and in WSL2).

@bogorad commented on GitHub (Nov 20, 2025): > darwin or linux? Linux (nixos, in Qemu, and in WSL2).
Author
Owner

@aashish2057 commented on GitHub (Nov 20, 2025):

Yeah its probably a darwin issue

@aashish2057 commented on GitHub (Nov 20, 2025): Yeah its probably a darwin issue
Author
Owner

@Cody-W-Tucker commented on GitHub (Nov 21, 2025):

@aashish2057 see #4575 seems like a bun issue with nix on darwin.

@Cody-W-Tucker commented on GitHub (Nov 21, 2025): @aashish2057 see #4575 seems like a bun issue with nix on darwin.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2975