Skip to content

Hash mismatch when using opencode flake.nix #4498

Closed

Description

@Cody-W-Tucker

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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 19, 2025
  2. ndrwstn commented on Nov 19, 2025

    @ndrwstn

    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.

  3. added and removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 19, 2025
  4. bogorad commented on Nov 19, 2025

    @bogorad

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

  5. Cody-W-Tucker commented on Nov 19, 2025

    @Cody-W-Tucker
    Author

    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

  6. bogorad commented on Nov 19, 2025

    @bogorad

    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
    ]
    
  7. Cody-W-Tucker commented on Nov 20, 2025

    @Cody-W-Tucker
    Author

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

    Thanks @Alb-O

  8. aashish2057 commented on Nov 20, 2025

    @aashish2057

    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.

  9. aashish2057 commented on Nov 20, 2025

    @aashish2057

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

  10. Cody-W-Tucker commented on Nov 20, 2025

    @Cody-W-Tucker
    Author

    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.

  11. aashish2057 commented on Nov 20, 2025

    @aashish2057

    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.

  12. bogorad commented on Nov 20, 2025

    @bogorad

    try

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

  13. bogorad commented on Nov 20, 2025

    @bogorad

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

  14. aashish2057 commented on Nov 20, 2025

    @aashish2057

    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/[email protected] (v1.0.10 available)
    opencode-node_modules> + [email protected]
    opencode-node_modules> + [email protected]
    opencode-node_modules> + [email protected]
    opencode-node_modules> + [email protected]
    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 -> ../../@[email protected]/node_modules/@actions/core
    opencode-node_modules>    @actions/exec -> ../../@[email protected]/node_modules/@actions/exec
    opencode-node_modules>    @actions/github -> ../../@[email protected]/node_modules/@actions/github
    opencode-node_modules>    @actions/http-client -> ../../@[email protected]/node_modules/@actions/http-client
    opencode-node_modules>    @actions/io -> ../../@[email protected]/node_modules/@actions/io
    opencode-node_modules>    @adobe/css-tools -> ../../@[email protected]/node_modules/@adobe/css-tools
    opencode-node_modules>    @agentclientprotocol/sdk -> ../../@[email protected]/node_modules/@agentclientprotocol/sdk
    opencode-node_modules>    @ai-sdk/amazon-bedrock -> ../../@[email protected]+d6123d32214422cb/node_modules/@ai-sdk/amazon-bedrock
    opencode-node_modules>    @ai-sdk/anthropic -> ../../@[email protected]+d6123d32214422cb/node_modules/@ai-sdk/anthropic
    opencode-node_modules>    @ai-sdk/gateway -> ../../@[email protected]+d6123d32214422cb/node_modules/@ai-sdk/gateway
    opencode-node_modules>    @ai-sdk/google -> ../../@[email protected]+d6123d32214422cb/node_modules/@ai-sdk/google
    opencode-node_modules>    @ai-sdk/google-vertex -> ../../@[email protected]+d6123d32214422cb/node_modules/@ai-sdk/google-vertex
    opencode-node_modules>    @ai-sdk/mcp -> ../../@[email protected]+d6123d32214422cb/node_modules/@ai-sdk/mcp
    opencode-node_modules>    @ai-sdk/openai -> ../../@[email protected]+d6123d32214422cb/node_modules/@ai-sdk/openai
    opencode-node_modules>    @ai-sdk/openai-compatible -> ../../@[email protected]+d6123d32214422cb/node_modules/@ai-sdk/openai-compatible
    opencode-node_modules>    @ai-sdk/provider -> ../../@[email protected]/node_modules/@ai-sdk/provider
    opencode-node_modules>    @ai-sdk/provider-utils -> ../../@[email protected]+d6123d32214422cb/node_modules/@ai-sdk/provider-utils
    opencode-node_modules>    @alloc/quick-lru -> ../../@[email protected]/node_modules/@alloc/quick-lru
    opencode-node_modules>    @ampproject/remapping -> ../../@[email protected]/node_modules/@ampproject/remapping
    opencode-node_modules>    @astrojs/cloudflare -> ../../@[email protected]+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
    
  15. aashish2057 commented on Nov 20, 2025

    @aashish2057

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

  16. bogorad commented on Nov 20, 2025

    @bogorad

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

  17. aashish2057 commented on Nov 20, 2025

    @aashish2057

    darwin or linux?

  18. bogorad commented on Nov 20, 2025

    @bogorad

    darwin or linux?

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

  19. aashish2057 commented on Nov 20, 2025

    @aashish2057

    Yeah its probably a darwin issue

  20. Cody-W-Tucker commented on Nov 21, 2025

    @Cody-W-Tucker
    Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions