Skip to content

fix(nix): use the required Bun version for builds - #12592

Merged
marius-kilocode merged 2 commits into
Kilo-Org:mainfrom
noobezlol:agent/fix-nix-bun-pin
Jul 28, 2026
Merged

fix(nix): use the required Bun version for builds#12592
marius-kilocode merged 2 commits into
Kilo-Org:mainfrom
noobezlol:agent/fix-nix-bun-pin

Conversation

@noobezlol

Copy link
Copy Markdown
Contributor

Issue

Fixes #12432

Context

The flake pinned Bun 1.3.14 only inside the development shell. nix run builds packages.default through nix/node_modules.nix and nix/kilo.nix, where callPackage still supplied nixpkgs' Bun 1.3.11. The repository's version guard therefore rejected the Nix build because package.json requires Bun 1.3.14.

Implementation

Extract the official Bun derivation into a reusable nix/bun.nix. Its version is derived from the root packageManager field, while the platform hashes remain explicit.

Both the development shell and the nix run package path now use that same derivation. The pinned Bun is passed to dependency installation and the final Kilo build, preventing the package and shell paths from drifting apart again.

Screenshots / Video

N/A — Nix build configuration only.

How to Test

Manual/local verification

  • Evaluated the complete flake with the official Nix container: nix flake check --no-build passed.
  • Evaluated packages.x86_64-linux.default.nativeBuildInputs; it contains bun-1.3.14.
  • git diff --check passed.

Reviewer test steps

  1. Run nix run github:Kilo-Org/kilocode/<branch>.
  2. Confirm dependency installation and the CLI build use Bun 1.3.14 instead of nixpkgs' Bun 1.3.11.
  3. Run nix develop and confirm bun --version also reports 1.3.14.

Blocked checks and substitute verification

  • A complete Nix application build was not run locally because it downloads and compiles the full dependency closure. Flake evaluation passed, and the final package's evaluated native build inputs explicitly select bun-1.3.14.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes

Get in Touch

GitHub: @noobezlol

@noobezlol
noobezlol marked this pull request as ready for review July 28, 2026 10:36
@kilo-code-bot

kilo-code-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .changeset/fix-nix-bun-pin.md
  • flake.nix
  • nix/bun.nix

Reviewed by claude-sonnet-5 · Input: 16 · Output: 5.3K · Cached: 310.3K

Review guidance: REVIEW.md from base branch main

@marius-kilocode

Copy link
Copy Markdown
Collaborator

Thanks @noobezlol

@marius-kilocode marius-kilocode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks right to me. The packages path picked up nixpkgs' bun through callPackage autofill while only the devShell had the pin, which is exactly why nix run broke. Sharing one derivation keyed off package.json's packageManager fixes the drift and matches how setup-bun in CI already resolves the version.

Two non-blocking follow-ups:

  • When packageManager bumps next, the hashes in nix/bun.nix go stale and builds fail with a hash mismatch. Can we add a short comment there with the prefetch command so the next bump knows what to update?
  • The overlay in flake.nix still calls node_modules.nix without the pinned bun and references nix/opencode.nix, which no longer exists. Worth a separate cleanup PR to fix or drop it.

@marius-kilocode
marius-kilocode merged commit 8c88048 into Kilo-Org:main Jul 28, 2026
27 checks passed
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
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.

flake.nix broken

2 participants