Skip to content

fix(nix): replace magic-nix-cache with Cachix#17928

Merged
alt-glitch merged 2 commits intomainfrom
fix/nix-ci-cachix
Apr 30, 2026
Merged

fix(nix): replace magic-nix-cache with Cachix#17928
alt-glitch merged 2 commits intomainfrom
fix/nix-ci-cachix

Conversation

@alt-glitch
Copy link
Copy Markdown
Collaborator

Problem

Nix CI has been flaky due to DeterminateSystems/magic-nix-cache-action hitting GitHub Actions Cache infrastructure limits:

  • TwirpErrorResponse { code: ResourceExhausted } — GHA's 10 GB per-repo cache quota exceeded
  • 200 req/min rate limit — magic-nix-cache uploads one entry per store path (thousands of small entries)
  • LRU eviction — PR branch caches evict main branch caches under pressure

This caused 10 consecutive Nix failures on main (Apr 29–30) and was declared 'unfixable infra flake' in #17836. It's actually a fixable architecture choice — DeterminateSystems themselves no longer use magic-nix-cache on their own repos.

Solution

Replace magic-nix-cache with Cachix — a dedicated Nix binary cache not subject to GHA's limits.

What other Nix-heavy repos do

Repo Caching Strategy
NixOS/nixpkgs Cachix
DeterminateSystems/ FlakeHub Cache (their newer product, NOT magic-nix-cache)
Ghostty Namespace Cloud volumes + Cachix
Hyprland cache-nix-action + Cachix
home-manager None

Changes

  • .github/actions/nix-setup/action.yml — swap magic-nix-cache for cachix-action v17
  • .github/workflows/nix.yml — pass CACHIX_AUTH_TOKEN secret
  • .github/workflows/nix-lockfile-check.yml — same
  • .github/workflows/nix-lockfile-fix.yml — same (both jobs)

First-run note

The cache starts empty — the first CI run after merge will be slightly slower (fetching from cache.nixos.org) but will populate the Cachix cache. Subsequent runs pull from Cachix at full speed.

magic-nix-cache caused recurring CI failures (TwirpErrorResponse
ResourceExhausted) by hitting GitHub Actions Cache's 10 GB limit and
200 req/min rate limit. This was flagged as 'unfixable infra flake' in
#17836 but is actually a fixable architecture choice.

Switch to Cachix (dedicated binary cache, no GHA quota dependency):
- Replace DeterminateSystems/magic-nix-cache-action with cachix/cachix-action
- Add cachix-auth-token input to nix-setup composite action
- Pass CACHIX_AUTH_TOKEN secret through all three nix workflows
- continue-on-error: true so cache failures never block CI

Cache 'hermes-agent' is public at hermes-agent.cachix.org.
Devs can pull locally with: cachix use hermes-agent
@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround area/nix Nix flake, NixOS module, container packaging labels Apr 30, 2026
@alt-glitch alt-glitch merged commit 9a14540 into main Apr 30, 2026
9 of 10 checks passed
@alt-glitch alt-glitch deleted the fix/nix-ci-cachix branch April 30, 2026 12:09
donald131 pushed a commit to donald131/hermes-agent that referenced this pull request May 2, 2026
* fix(nix): replace magic-nix-cache with Cachix

magic-nix-cache caused recurring CI failures (TwirpErrorResponse
ResourceExhausted) by hitting GitHub Actions Cache's 10 GB limit and
200 req/min rate limit. This was flagged as 'unfixable infra flake' in
NousResearch#17836 but is actually a fixable architecture choice.

Switch to Cachix (dedicated binary cache, no GHA quota dependency):
- Replace DeterminateSystems/magic-nix-cache-action with cachix/cachix-action
- Add cachix-auth-token input to nix-setup composite action
- Pass CACHIX_AUTH_TOKEN secret through all three nix workflows
- continue-on-error: true so cache failures never block CI

Cache 'hermes-agent' is public at hermes-agent.cachix.org.
Devs can pull locally with: cachix use hermes-agent

* fix: correct cachix-action commit SHA pin

---------

Co-authored-by: Hermes Agent <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/nix Nix flake, NixOS module, container packaging P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants