From fd15e1d15e1a9eba15596ab3b7f8edb39b421aa8 Mon Sep 17 00:00:00 2001 From: jappeace-sloth Date: Thu, 9 Apr 2026 08:26:37 +0000 Subject: [PATCH] Replace actions/cache with nix-community/cache-nix-action for nix store 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 --- .github/workflows/ci.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bbf1793..c1482e5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,11 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Local cache - uses: actions/cache@v4 - with: - path: /nix/store - key: "${{ runner.os }}-nix-cache" - uses: cachix/install-nix-action@v31 with: nix_path: nixpkgs=channel:nixos-unstable @@ -24,6 +19,11 @@ jobs: access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} extra-substituters = https://nix-cache.jappie.me extra-trusted-public-keys = nix-cache.jappie.me:WjkKcvFtHih2i+n7bdsrJ3HuGboJiU2hA2CZbf9I9oc= + - name: Nix store cache + uses: nix-community/cache-nix-action@v6 + with: + primary-key: nix-${{ hashFiles('npins/sources.json', 'nix/*.nix', '*.cabal') }} + restore-prefixes-first-match: nix- - run: nix-build - run: nix-shell --run "echo OK" - run: nix-shell --run "cabal build"