Repository navigation
fix(setup-nix): keep substituters from extra_nix_config - #60
Merged
Merged
Conversation
cachix-action's `cachix use` writes a plain `substituters` list to the user's nix.conf. Its parser drops `extra-substituters`, and the trusted runner applies the user conf last, so every substituter a caller added through `extra_nix_config` was lost. Skip `cachix use` and add the `hakula` cache through install-nix-action's `extra_nix_config` instead. Pushing goes through the auth token and the Cachix API, so it does not depend on the substituter.
hakula139
force-pushed
the
fix/setup-nix-substituters
branch
from
November 10, 2026 08:50
322252e to
7fa911d
Compare
hakula139
added a commit
that referenced
this pull request
Nov 10, 2026
## Summary Prepare 3.1.0, a minor release for everything merged since 3.0.1. The notes cover the reusable `python.yml`, `node.yml`, and `rust.yml` workflows with Codecov over OIDC and the CI conventions in `docs/ci.md` (#61, #73), `dk.writeNuApplication` (#63), the hooks the baseline now enables by default (#54), the Ruff and uv floors that move the pinned hooks from Ruff 0.15.14 to 0.17.3 and may reformat consumer code (#61), the `github` helper's `--private` switch, extra required checks, and ruleset template changes (#55, #65, #67), the release workflow's plugin manifest check (#70), the Renovate preset's broader matching (#68), and the fixes to the dev shell hook's stdout, the Nushell argument guard, and `setup-nix` substituters (#74, #62, #60). The ignore-rule cleanup (#58) and the contributor rule in `AGENTS.md` (#64) have no consumer-visible effect, so the notes leave them out. Every change keeps existing callers working, with two judgment calls under [Choose the version](https://github.com/hakula139/devkit/blob/main/docs/releasing.md#choose-the-version): - `github ruleset --config` is removed (#67), which the policy would class as major. No repository calls it, so it ships as minor, and the entry names the removal. - The plugin manifest check (#70) can fail a `release.yml` run. Of the two callers, one has no `.claude-plugin/plugin.json`, and the other reads its package version from that manifest, so neither run can fail. The copy-ready `v3` references in `docs/` stay unchanged. The shared header and earlier release sections are unchanged, with the new compare reference inside its release section. ## Test plan - [x] Drafted the section with `nix run .#changelog -- v3.1.0`, then curated it against each PR's diff - [x] Evaluated devkit's locked nixpkgs and `nixpkgs-unstable`: Ruff 0.15.14 → 0.17.3 and uv 0.11.21 → 0.13.5 - [x] Header and complete release history byte-preservation check against `main` - [x] `nix develop -c run-hooks` - [x] Normal commit and push hooks - [x] `nix flake check --all-systems` - [x] GitHub CI: Linux, macOS, and CI Result
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
setup-nixlost every substituter a caller added throughextra_nix_config. install-nix-action writes those lines to/etc/nix/nix.conf, and cachix-action'scachix use hakulathen writes a plainsubstituters = https://cache.nixos.org <plain substituters from the global conf> https://hakula.cachix.orgto~/.config/nix/nix.conf. cachix's parser keeps only plainsubstituterslines, soextra-substitutersnever makes it into that list, and because the runner user is trusted, the later user conf replaces the whole setting. In nixos-config's CI on Nix 2.34.9,nix config showwent fromcache.nixos.org cache.numtide.comtocache.nixos.org hakula.cachix.org.cachix-action now runs with
skipAddingSubstituter: true, and the install step adds thehakulacache itself asextra-substitutersandextra-trusted-public-keys, ahead offallback = trueand the caller's lines. The key is the one the Cachix API publishes forhakula, which also matches the flake'snixConfig.Pushing is unchanged. In cachix-action v17,
skipAddingSubstituteronly skipscachix use, while the push mode is chosen from the auth token andskipPush, and both the daemon (cachix daemon run hakula) and store-scan pushes talk to the Cachix API with the token, never consulting Nix's substituters.nix-cache.yml's owncachix pushandcachix pinstill find thecachixbinary the action installs.A caller whose
extra_nix_configsets a plainsubstitutersortrusted-public-keysnow replaces thehakulaentry, whichcachix useused to re-add on trusted runners. That costs only cache misses, and the caller's explicit assignment winning is the expected contract.Test plan
A temporary workflow ran
setup-nixwithextra_nix_configaddingcache.numtide.comand its key, thennix config show | grep -E '^(extra-)?(substituters|trusted-public-keys)', on Linux and macOS:This branch also left no
~/.config/nix/nix.confbehind. The workflow is removed again.GitHub CI: the Linux leg still substitutes from
https://hakula.cachix.org, and cachix-action logsNot adding Cachix cache to substitutersandskipPush is enablednix flake check --all-systemsandnix develop -c run-hooksIndependent review
Pushing from the default branch is untested, since a PR run skips it, and rests on the cachix-action code path above.