Nix package: hash mismatch in node_modules fixed-output derivation #4439

Closed
opened 2026-02-16 17:43:47 -05:00 by yindo · 3 comments
Owner

Originally created by @jackblanc on GitHub (Jan 8, 2026).

Originally assigned to: @rekram1-node on GitHub.

Problem

The Nix package fails to build due to a hash mismatch in the node_modules fixed-output derivation.

error: hash mismatch in fixed-output derivation '/nix/store/...-opencode-node_modules-1.1.6.drv':
         specified: sha256-rNGq0yjL5ZHYVg+zyV4nFPug4gqhKhyOnfebaufyd34=
            got:    sha256-X6FNBjb2b/c/j1FGzw6dZlbbTpPHuHuhK/K2ogf2FlI=

Environment

  • Branch: dev (commit 61aeb2a2a7)
  • Also affects: v1.1.6 tag
  • Platform: aarch64-darwin

Cause

The nix/hashes.json file contains a stale hash that doesn't match the current node_modules content. This happens when dependencies change but the hash file isn't updated.

Fix

Update nix/hashes.json with the correct hash:

{
  "nodeModules": "sha256-X6FNBjb2b/c/j1FGzw6dZlbbTpPHuHuhK/K2ogf2FlI="
}

Or run the hash update script if one exists in the repo.

Originally created by @jackblanc on GitHub (Jan 8, 2026). Originally assigned to: @rekram1-node on GitHub. ## Problem The Nix package fails to build due to a hash mismatch in the `node_modules` fixed-output derivation. ``` error: hash mismatch in fixed-output derivation '/nix/store/...-opencode-node_modules-1.1.6.drv': specified: sha256-rNGq0yjL5ZHYVg+zyV4nFPug4gqhKhyOnfebaufyd34= got: sha256-X6FNBjb2b/c/j1FGzw6dZlbbTpPHuHuhK/K2ogf2FlI= ``` ## Environment - Branch: `dev` (commit 61aeb2a2a741468b42ddde2cfb1f08897d9ab648) - Also affects: `v1.1.6` tag - Platform: aarch64-darwin ## Cause The `nix/hashes.json` file contains a stale hash that doesn't match the current `node_modules` content. This happens when dependencies change but the hash file isn't updated. ## Fix Update `nix/hashes.json` with the correct hash: ```json { "nodeModules": "sha256-X6FNBjb2b/c/j1FGzw6dZlbbTpPHuHuhK/K2ogf2FlI=" } ``` Or run the hash update script if one exists in the repo.
yindo added the nix label 2026-02-16 17:43:47 -05:00
yindo closed this issue 2026-02-16 17:43:47 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 8, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #4498: Hash mismatch when using opencode flake.nix

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 8, 2026): This issue might be a duplicate of existing issues. Please check: - #4498: Hash mismatch when using opencode flake.nix Feel free to ignore if none of these address your specific case.
Author
Owner

@jackblanc commented on GitHub (Jan 8, 2026):

OpenCode just filed this without asking me 😂

@jackblanc commented on GitHub (Jan 8, 2026): OpenCode just filed this without asking me 😂
Author
Owner

@jackblanc commented on GitHub (Jan 8, 2026):

Closing - the issue was that I was pinned to an older commit (61aeb2a) before the hash was updated. After running nix flake update opencode to get the latest dev (adae0d1), the build succeeds with the upstream hash. The hash automation is working correctly.

@jackblanc commented on GitHub (Jan 8, 2026): Closing - the issue was that I was pinned to an older commit (61aeb2a) before the hash was updated. After running `nix flake update opencode` to get the latest dev (adae0d1), the build succeeds with the upstream hash. The hash automation is working correctly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4439