Skip to content

ci(mac): fix nix cache config#24

Merged
Typas merged 2 commits into
masterfrom
ci/mac-nix-cache
Apr 26, 2026
Merged

ci(mac): fix nix cache config#24
Typas merged 2 commits into
masterfrom
ci/mac-nix-cache

Conversation

@Typas

@Typas Typas commented Apr 26, 2026

Copy link
Copy Markdown
Owner

The original cache setup had three problems: v6 of cache-nix-action is outdated; the key hashed only init.sh, missing flake.lock which is what actually pins the nix-darwin package set; ~/.cache/nix (flake input tarballs) was not cached so nixpkgs was re-fetched every run; and the 1 GiB store cap was too small for a full nix-darwin activation, causing evictions. Raise the cap to 5 GiB and drop the now-redundant profile source since mac-nix-setup writes nix to GITHUB_PATH.

Typas and others added 2 commits April 26, 2026 10:33
The original cache setup had three problems: v6 of cache-nix-action
is outdated; the key hashed only init.sh, missing flake.lock which
is what actually pins the nix-darwin package set; ~/.cache/nix (flake
input tarballs) was not cached so nixpkgs was re-fetched every run;
and the 1 GiB store cap was too small for a full nix-darwin activation,
causing evictions. Raise the cap to 5 GiB and drop the now-redundant
profile source since mac-nix-setup writes nix to GITHUB_PATH.

Co-Authored-By: Claude <noreply@anthropic.com>
Without writing to GITHUB_PATH, nix is absent from PATH in subsequent
steps and post-run hooks. cache-nix-action's post-job step failed with
exit 127 when calling nix --version, silently skipping the cache save.
nix profile add also installs just into ~/.nix-profile/bin which was
equally invisible, causing a command not found at the end of init.sh.

Co-Authored-By: Claude <noreply@anthropic.com>
@Typas Typas merged commit 25abdbf into master Apr 26, 2026
8 checks passed
@Typas Typas deleted the ci/mac-nix-cache branch April 26, 2026 02:52
Typas added a commit that referenced this pull request Apr 30, 2026
cache-nix-action did not speed up mac CI runs in practice. Reverts:
- "ci(mac): fix nix cache config (#24)" (25abdbf)
- "ci(mac): cache nix store between runs" (8513617)

Restores sourcing nix-daemon.sh before init.sh and removes the
GITHUB_PATH additions that were only needed for the cache post-step.

Co-Authored-By: Claude <noreply@anthropic.com>
Typas added a commit that referenced this pull request Apr 30, 2026
* ci(mac): fix nix cache config

The original cache setup had three problems: v6 of cache-nix-action
is outdated; the key hashed only init.sh, missing flake.lock which
is what actually pins the nix-darwin package set; ~/.cache/nix (flake
input tarballs) was not cached so nixpkgs was re-fetched every run;
and the 1 GiB store cap was too small for a full nix-darwin activation,
causing evictions. Raise the cap to 5 GiB and drop the now-redundant
profile source since mac-nix-setup writes nix to GITHUB_PATH.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(mac-nix-setup): add nix bins to GITHUB_PATH

Without writing to GITHUB_PATH, nix is absent from PATH in subsequent
steps and post-run hooks. cache-nix-action's post-job step failed with
exit 127 when calling nix --version, silently skipping the cache save.
nix profile add also installs just into ~/.nix-profile/bin which was
equally invisible, causing a command not found at the end of init.sh.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Typas added a commit that referenced this pull request Apr 30, 2026
cache-nix-action did not speed up mac CI runs in practice. Reverts:
- "ci(mac): fix nix cache config (#24)" (25abdbf)
- "ci(mac): cache nix store between runs" (8513617)

Restores sourcing nix-daemon.sh before init.sh and removes the
GITHUB_PATH additions that were only needed for the cache post-step.

Co-Authored-By: Claude <noreply@anthropic.com>
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.

1 participant