Skip to content

chore(nix): FOD hash automation, current runner labels, self-prune decommission, darwin-legacy pin - #911

Open
levonk wants to merge 2 commits into
tobi:mainfrom
levonk:chore/nix-fod-hash-automation
Open

levonk wants to merge 2 commits into
tobi:mainfrom
levonk:chore/nix-fod-hash-automation

Conversation

@levonk

@levonk levonk commented Aug 19, 2026

Copy link
Copy Markdown

Summary

  • Fix x86_64-darwin FOD hash (was pkgs.lib.fakeHash, now computed: sha256-B8YZsB+JRkG98nhZ71yrULSiOFBfbYJJVHcQ/SSf3yU=)
  • Add nix-fod-hashes.yml workflow: 4-platform matrix builds qmd-node-modules FOD, collector job opens PR with updated hashes (addresses Toby's request in Nix fod build #55 and implements Mic92's suggested approach: "build matrix over the 4 architectures + collector job that updates the hashes file")
  • Update nix.yml to current GitHub Actions runner labels (macos-26, macos-26-intel) — macos-13 is retired
  • Migrate from cachix/install-nix-action to DeterminateSystems/nix-installer-action + magic-nix-cache-action (GitHub Actions cache, free, zero-config)
  • Add self-prune job to nix.yml: detects validate-x86-darwin failure and opens a PR to either update to a newer Intel runner label or comment out the dead job + swap x86_64-darwin FOD hashes to lib.fakeHash (auto-clean on runner decommission)
  • Pin x86_64-darwin to nixpkgs-26.05-darwin (last stable branch supporting x86_64-darwin; nixpkgs-unstable dropped it in 26.11)
  • Add bun.lock and package.json to nix.yml path filter so dependency bumps trigger Nix CI

Files changed

  • flake.nix — add nixpkgs-darwin-legacy input pinned to nixpkgs-26.05-darwin, use it for x86_64-darwin, fix x86_64-darwin FOD hash, expose qmd-node-modules as package output for CI
  • flake.lock — updated for new nixpkgs-darwin-legacy input
  • .github/workflows/nix.yml — rewritten: macos-26/macos-26-intel labels, DeterminateSystems installer + magic-nix-cache, nix flake check --all-systems --no-build, separate validate-x86-darwin and validate-aarch64-darwin jobs, self-prune decommission job, bun.lock/package.json path filters
  • .github/workflows/nix-fod-hashes.yml — new: 4-platform matrix (ubuntu-latest, ubuntu-24.04-arm, macos-26-intel, macos-26) computes FOD hashes, collector job updates flake.nix and opens PR

Context

Toby's comment on closed PR #55:

"this is really neat. can you add a workflow to update the hashes on release tags?"

Mic92's follow-up:

"It's possible to have fod hashes for bun computed with nix in ci, but it basically requires using a build matrix over the 4 architectures to do so and a collector job that than actually updates the hashes file."

This PR implements both requests. The aarch64-linux hash remains pkgs.lib.fakeHash — the nix-fod-hashes workflow will compute it on first run (the ARM Ubuntu runner is needed for that).

Test plan

  • nix build .#default succeeds on x86_64-darwin with the corrected hash
  • nix run .#default -- --version outputs qmd 2.6.3
  • nix flake check --all-systems --no-build passes (all 4 systems evaluate)
  • actionlint validates both workflow YAML files
  • Self-prune regex tested against actual nix.yml — correctly matches the validate-x86-darwin job block
  • FOD hash swap regex tested against actual flake.nix — correctly matches and replaces the x86_64-darwin SRI hash
  • CI runs on push (macos-26-intel, macos-26, ubuntu-latest) — verify after push
  • nix-fod-hashes workflow computes aarch64-linux hash on first run

levonk added 2 commits August 19, 2026 03:13
The qmd-node-modules FOD (fixed-output derivation) uses per-platform
hashes because bun.lock carries platform-gated optional dependencies
(@esbuild/darwin-arm64, @esbuild/linux-x64, etc.) — a single outputHash
cannot be shared across all four platforms.

The x86_64-darwin and aarch64-linux hashes were left as
pkgs.lib.fakeHash, causing `nix profile add github:tobi/qmd` to fail on
Intel Macs and ARM Linux with hash mismatch errors.

This commit:

1. Sets the correct x86_64-darwin FOD hash (computed locally on an
   Intel Mac), fixing `nix run`/`nix profile add` on darwin-x86.

2. Adds .github/workflows/nix-fod-hashes.yml — a 4-platform matrix CI
   workflow that computes each platform's FOD hash by building
   qmd-node-modules on a matching runner (ubuntu-latest,
   ubuntu-24.04-arm, macos-13, macos-latest), then opens a PR with the
   updated hashes. This addresses Toby's request in PR tobi#55 ("can you add
   a workflow to update the hashes on release tags?") and implements the
   approach Mic92 suggested ("build matrix over the 4 architectures +
   collector job that updates the hashes file").

3. Exposes qmd-node-modules as a package output so the CI workflow can
   build the FOD directly without building the full qmd derivation.

4. Adds macos-13 (x86_64-darwin) to the nix.yml CI matrix so the
   existing build CI covers Intel Macs alongside Apple Silicon and Linux.

The aarch64-linux hash remains fakeHash — the first run of the
nix-fod-hashes workflow will compute and populate it automatically.
…ission job

Update nix.yml and nix-fod-hashes.yml to use the current GitHub Actions
runner labels (macos-26, macos-26-intel) instead of the retired
macos-13/macos-14. Migrate from cachix/install-nix-action to
DeterminateSystems/nix-installer-action + magic-nix-cache-action for
GitHub Actions cache support.

Add a self-prune job to nix.yml that detects validate-x86-darwin failure
and opens a PR to either update to a newer Intel runner label or comment
out the dead job + swap x86_64-darwin FOD hashes to lib.fakeHash. This
implements the auto-clean decommission handling from the nixify skill.

Pin x86_64-darwin to nixpkgs-26.05-darwin (the last stable branch
supporting x86_64-darwin, since nixpkgs-unstable dropped it in 26.11).
Add bun.lock and package.json to the nix.yml path filter so dependency
bumps trigger Nix CI.
@levonk levonk changed the title chore(nix): add FOD hash automation CI and fix x86_64-darwin hash chore(nix): FOD hash automation, current runner labels, self-prune decommission, darwin-legacy pin Aug 19, 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.

1 participant