Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/actions/setup-nix/action.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
name: 'Setup Nix'
description: 'Install Nix and configure Cachix'
description: 'Install Nix and configure cache'
runs:
using: 'composite'
steps:
- name: Install Nix
uses: cachix/install-nix-action@0b0e072294b088b73964f1d72dfdac0951439dbd # v31.8.4
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
with:
github_access_token: ${{ github.token }}

- name: Setup Cachix (numtide)
uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad # v16
- name: Cache Nix store
uses: nix-community/cache-nix-action@b426b118b6dc86d6952988d396aa7c6b09776d08 # v7
with:
name: numtide
authToken: ''
primary-key: nix-${{ runner.os }}
Copy link

Copilot AI Jan 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cache key should include a hash of the flake.lock file to ensure the cache is invalidated when Nix dependencies change. Currently, using only runner.os means the cache will persist even when flake.lock is updated, potentially causing builds to use outdated dependencies.

Consider changing the primary-key to include the flake.lock hash, for example:
primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.lock') }}

Suggested change
primary-key: nix-${{ runner.os }}
primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.lock') }}

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Cache key should include a hash of flake.lock to ensure cache invalidation when dependencies change. Without this, the cache may serve stale dependencies after lock file updates.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/actions/setup-nix/action.yaml, line 14:

<comment>Cache key should include a hash of `flake.lock` to ensure cache invalidation when dependencies change. Without this, the cache may serve stale dependencies after lock file updates.</comment>

<file context>
@@ -8,6 +8,11 @@ runs:
+    - name: Cache Nix store
+      uses: nix-community/cache-nix-action@b426b118b6dc86d6952988d396aa7c6b09776d08 # v7
+      with:
+        primary-key: nix-${{ runner.os }}
+
     - name: Setup Cachix (numtide)
</file context>
Suggested change
primary-key: nix-${{ runner.os }}
primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.lock') }}
Fix with Cubic


- name: Load Nix development environment
shell: bash
Expand Down
Loading