Skip to content

Replace actions/cache with cache-nix-action for nix store#32

Merged
jappeace merged 1 commit into
jappeace:masterfrom
jappeace-sloth:fix/ci-nix-cache
Apr 9, 2026
Merged

Replace actions/cache with cache-nix-action for nix store#32
jappeace merged 1 commit into
jappeace:masterfrom
jappeace-sloth:fix/ci-nix-cache

Conversation

@jappeace-sloth
Copy link
Copy Markdown

Summary

  • Replace actions/cache@v4 on /nix/store with nix-community/cache-nix-action@v6
  • Move cache step after cachix/install-nix-action so /nix exists
  • Use content-addressed cache key based on npins/sources.json, nix/*.nix, and *.cabal hashes

The old actions/cache was placed before nix installation and could not write to the daemon-owned /nix/store anyway — tar extraction produced thousands of permission errors silently. cache-nix-action handles nix store permissions correctly via sudo and SQLite database merging.

Test plan

  • CI nix job passes
  • Cache saved on first run (check "Post Nix store cache" step)
  • Cache restored on subsequent run (check "Nix store cache" step)

🤖 Generated with Claude Code

actions/cache@v4 on /nix/store was placed before nix installation and
could not write to the daemon-owned store directory anyway. Replace with
nix-community/cache-nix-action@v6 which understands nix store permissions,
and move it after cachix/install-nix-action so /nix exists.

Cache key now includes npins/sources.json, nix/*.nix and *.cabal hashes
for proper invalidation.

Prompt: apply the same fix to the haskell-template-project, update your ci-nix skill as well

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jappeace jappeace merged commit f10fe07 into jappeace:master Apr 9, 2026
13 checks passed
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.

2 participants