Skip to content

fix(nix): override broken opencode 2.2.5 node_modules hash - #136

Merged
j5ik2o merged 1 commit into
mainfrom
fix/opencode-225-node-modules-hash
Nov 4, 2026
Merged

j5ik2o merged 1 commit into
mainfrom
fix/opencode-225-node-modules-hash

Conversation

@j5ik2o

@j5ik2o j5ik2o commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

概要

nixpkgs の opencode 2.2.5 は node_modules の固定出力ハッシュが壊れており、make check-update が失敗します。

error: hash mismatch in fixed-output derivation
       '/nix/store/…-opencode-node_modules-2.2.5.drv':
  specified: sha256-xfOVcw1+waLVNhFDwzOtzxrUSQEogvn88YomydOlhwc=
       got:    sha256-dIveiaiPFGSItwLyeMuPDxTE9gpvvnlTCB/+nG24qCc=

上流 issue: NixOS/nixpkgs#582673 / 修正 PR: NixOS/nixpkgs#582675(未マージ)

変更

  • aarch64-darwin かつ opencode.version == "2.2.5" のときだけ、node_modules の outputHash を実測値へ差し替える overlay を追加
  • flake.nix(homeConfigurations 用)と darwin/default.nix(nix-darwin システム用)の両方に反映
  • 上流でバージョンが上がれば条件から外れて自動的に無効化される

検証

  • 差し替え後の opencode-node_modules-2.2.5 のビルド成功を確認
  • make check-update の完走を確認(このコメント時点で実行中)

🤖 Generated with Claude Code


Note

Low Risk
Packaging-only, version-gated hash override with no runtime or security behavior changes.

Overview
Adds a temporary nixpkgs overlay so opencode 2.2.5 builds when upstream’s fixed-output node_modules hash is wrong (NixOS/nixpkgs#582673). The override replaces outputHash with the value produced under bun 1.4.4, unblocking make check-update and related eval/builds.

The same workaround is wired in flake.nix (customOverlay for Home Manager) and darwin/default.nix (nix-darwin system overlay). Home Manager applies it only on aarch64-darwin when the package is still 2.2.5; the darwin module keys off version alone. Once nixpkgs bumps opencode, the condition stops matching and the override is skipped.

Reviewed by Cursor Bugbot for commit 2af1536. Configure here.

Summary by CodeRabbit

  • 変更点
    • macOS(Apple Silicon)で、バージョン 2.2.5 の opencode が正しい依存関係ハッシュでビルドされるようになりました。

nixpkgs builds opencode with a stale bunInstall output hash after the
bun 1.4.4 update, so node_modules fails with a fixed-output mismatch
(NixOS/nixpkgs#582673). Override only for 2.2.5 with the hash produced
on aarch64-darwin so package updates are not blocked.

Co-Authored-By: Claude Code <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

darwin/default.nixとflake.nixのoverlayに、opencodeのバージョンが2.2.5の場合にnode_modulesのoutputHashを上書きする分岐を追加しました。flake.nixではaarch64-darwinの場合に適用します。

Changes: opencodeのoutputHash上書き

Layer / File(s) Summary
overlayへの上書き設定
darwin/default.nix, flake.nix
バージョンが2.2.5の場合にnode_modulesのoutputHashを指定値に変更します。それ以外の場合は既存のprev.opencodeを使用します。flake.nixではaarch64-darwinの場合に適用します。

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 2af15

No current configuration is affected by this forward-compatible override, so the change is mergeable with normal validation.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T08:34:54.817529Z 2af1536 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@j5ik2o
j5ik2o merged commit b42f9ab into main Nov 4, 2026
4 of 5 checks passed
@j5ik2o
j5ik2o deleted the fix/opencode-225-node-modules-hash branch November 4, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant