Skip to content

ci: add cache-nix-action for store-path caching across cold runs (#61)#151

Merged
dannyfaris merged 1 commit into
mainfrom
claude/github-issues-cloud-env-RswWe
May 31, 2026
Merged

ci: add cache-nix-action for store-path caching across cold runs (#61)#151
dannyfaris merged 1 commit into
mainfrom
claude/github-issues-cloud-env-RswWe

Conversation

@dannyfaris
Copy link
Copy Markdown
Owner

What

Adds a nix-community/cache-nix-action@v6 step to .github/workflows/ci.yaml, between cachix/install-nix-action and nix flake check. Closes #61.

It amortises the non-niri half of the desktop closure that a fresh GH Actions runner rebuilds on every cold run — Quickshell + Qt6 + matugen + DMS + xwayland-satellite + foot and their transitive deps. This is actions/cache-shaped storage for build outputs, orthogonal to the niri.cachix.org substituter trust lines added in #59 (those are a substituter; this is not).

Key semantics

  • Keyed on os × arch × hashFiles('flake.lock') — a lock bump invalidates cleanly.
  • Restore PR branches from the os×arch prefix seeded on main; the squash-auto-merge flow reseeds the cache after each PR lands.
  • GC to 5G before save so x86_64 + aarch64 entries coexist under the 10 GB per-repo limit.
  • Purge dead prefix entries on a 7-day last-accessed window, never evicting the run's own primary key (purge-primary-key: never).

Why this and not Cachix/FlakeHub/Attic

Those are larger trust/operational delegations than a one-operator / three-host project warrants today. Per the issue's sequencing: cache-nix-action first; revisit Cachix/Attic only if hit rate stays below ~60% over a month or a second major source-built dep arrives. magic-nix-cache-action is excluded (ambiguous post-EOL support status).

Verification

  • YAML parses; inputs match issue ci: add nix-community/cache-nix-action for store-path caching across cold runs #61's implementation sketch exactly.
  • Peer-reviewed (subagent) against the cache-action v6 README — input names, step ordering, and purge-primary-key: never purge-safety all confirmed. Verdict: approve.
  • actionlint runs as a flake-check pre-commit hook (parts/checks.nix), so CI lints this workflow as part of the gate.
  • Runtime success signal (post-merge): two consecutive runs — first populates, second restores; wall-time reduction on the second run. No local Nix in the authoring environment, so this is observed on the merged CI runs.

Acceptance criteria (#61)

  • cache-nix-action@v6 step between install-nix-action and nix flake check
  • Cache key includes runner.arch + hashFiles('flake.lock')
  • gc-max-store-size-linux: 5G
  • actionlint-clean (gated by flake-check)
  • No matrix regression (flake-check (x86_64-linux) / (aarch64-linux) untouched)
  • Two-run populate→restore wall-time reduction — observable on merged CI

https://claude.ai/code/session_01R9nbBuTjy2rkiMYJ6NJ1G1


Generated by Claude Code

Amortise the non-niri half of the desktop closure (Quickshell, Qt6,
matugen, DMS, xwayland-satellite, foot and transitive deps) that a
fresh GH Actions runner otherwise rebuilds every cold run.

Output-cache storage (actions/cache-shaped), orthogonal to the
niri.cachix.org substituter trust lines (#59). Keyed on os × arch ×
flake.lock hash; PR branches restore from the os×arch prefix seeded
on main. GC to 5G before save keeps both arch entries under the 10 GB
per-repo limit; a 7-day last-accessed purge sweeps dead prefixes
without evicting the run's own primary key.

cache-nix-action chosen over Cachix/FlakeHub/Attic per the issue's
trust-delegation reasoning; revisit only if hit rate stays below ~60%
over a month or a second major source-built dep arrives.

https://claude.ai/code/session_01R9nbBuTjy2rkiMYJ6NJ1G1
@dannyfaris dannyfaris enabled auto-merge (squash) May 31, 2026 12:16
@dannyfaris dannyfaris merged commit 21d0055 into main May 31, 2026
4 checks passed
@dannyfaris dannyfaris deleted the claude/github-issues-cloud-env-RswWe branch May 31, 2026 12:22
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.

ci: add nix-community/cache-nix-action for store-path caching across cold runs

2 participants