Fix the Nix flake, and stop the hash check reporting false success

Merged
JE
4mo ago
+283-52

v0.8.0 shipped a flake that cannot build

go: go.mod requires go >= 1.26.5 (running go 1.26.4; GOTOOLCHAIN=local)

#533 raised go.mod to 1.26.5 on 2026-07-13. flake.lock still pinned a
nixpkgs from 2026-06-28 carrying 1.26.4, and release prep never updates the
lock. Every nix build user has been broken since, across two releases.

Why nothing caught it

Both safeguards were blind, independently:

  • update-nix-flake.sh reported success on failure. It ran
    nix build ... || true, then treated the presence of
    building '...basecamp-0.8.0-go-modules.drv' as proof of success. Nix prints that
    when the build starts — so a hard failure printed
    vendorHash: verified (build succeeded). It said exactly that during the v0.8.0
    release, which is how a broken flake got through a pre-tag check that existed to
    prevent this.
  • nix-verify could not fail the run. continue-on-error: true, and it only runs
    on tags — weeks after the drift is introduced. For v0.8.0 it never ran at all,
    because the AUR outage reddened release and skipped every needs: [release] job.

The fix

Lock + hash. Updating nixpkgs to one carrying 1.26.5 surfaced a second defect the
Go error had been masking — the recorded vendorHash was stale as well:

specified: sha256-hG1eymlnBAhRDtOqi078uVwMwEFC9+8ilft1LOW7SzY=
got:       sha256-DmCW1Ms9TmcvEzvNIcqutf1bxtOpN+MjpPO0XP1VaZQ=

Both corrected. nix build now exits 0 and the resulting binary reports
basecamp version 0.8.0.

Fail closed. The release-time check now reads the real exit status. A failure that
is not a hash mismatch is fatal instead of shrugged off, and when it does update a
hash it rebuilds to prove the new one works — which the old code never did.

Catch it at the source. nix-verify is no longer continue-on-error, and a
path-filtered nix-build job runs on PRs touching go.mod, go.sum, flake.* or
nix/**, so a Go bump that outpaces the lock fails its own PR.

Verification

Run against the real Docker path, not reasoned about:

ScenarioBeforeAfter
Stale lock (the v0.8.0 condition)vendorHash: verified (build succeeded), exit 0exit 1, prints the Go version error
Fixed lock + hash—vendorHash: verified (build succeeded), exit 2
nix build on this branchfailsexit 0, binary runs

bin/ci exit 0, actionlint clean, zizmor no findings.

Consequence for the queue

0.8.1 cannot be a bare manifest bump — it has to carry this first, or it repeats the
broken Nix release. Let release.sh stamp both plugin manifests as part of that
release rather than bumping them standalone.


Summary by cubic

Fixes the broken Nix flake by updating flake.lock to a nixpkgs with Go 1.26.5 and correcting the Go vendorHash. Makes the hash check accurate and fail-closed so a flake that can’t build can’t ship again.

  • Bug Fixes

    • Update flake.lock to a revision with Go 1.26.5.
    • Update nix/package.nix vendorHash.
    • Only rewrite vendorHash when nix reports a fixed-output hash mismatch and the captured value is SRI-shaped; then rebuild to verify.
  • CI

    • Make release nix-verify blocking (remove continue-on-error).
    • Fail closed end-to-end: use the real nix build exit code, build unconditionally, update the hash only on mismatch, and make update-nix-hash now propagates real failures (RC 0=updated, 2=no-op).
    • Add a path-filtered nix-build job in PR CI for changes to go.mod, go.sum, flake.*, and nix/**.
    • Add regression tests for the hash-check script (stubbed Docker), including a case that rejects unrelated “got:” logs.