Skip to content

ci: install Nix with nix-quick-install-action in the docs job - #3

Merged
sigma merged 1 commit into
mainfrom
ci/quick-install-nix
Sep 7, 2026
Merged

ci: install Nix with nix-quick-install-action in the docs job#3
sigma merged 1 commit into
mainfrom
ci/quick-install-nix

Conversation

@sigma

@sigma sigma commented Sep 7, 2026

Copy link
Copy Markdown
Member

docs.yml's build job spent more time installing Nix than doing its work. It builds nothing at all — one nix eval, two pip installs — so the multi-user daemon and 32 nixbld users the Determinate installer stands up are pure overhead.

Measured

Baseline, last three runs of each:

Job Installer Nix work Job total
docs.yml → build 24s, 23s, 26s nix eval .#manifest 8s, 8s, 9s 42s, 40s, 47s
check.yml → check 8s, 10s, 8s nix flake check 29s, 31s, 28s 42s, 48s, 42s

check.yml was swapped too, and measured worse

The first push of this branch moved both eval-only jobs. The check.yml result:

Installer nix flake check Job total
before 8-10s 28-31s 42-48s
after 1s 60s 67s

7s saved on install, 30s lost on evaluation. The cause is that nix-installer-action installs Determinate Nix (Installing Determinate Nix using the --determinate flag), whose parallel evaluator is roughly twice as fast on this flake — and checkRegistry forcing every advertised system is exactly that workload. nix-quick-install-action gives upstream Nix 2.34.7.

So check.yml is reverted to the Determinate installer, with the measurement recorded in a comment. docs.yml wins the same trade because its evaluation is 8-9s rather than 30s: even if it doubles, that is +8s against -24s.

cachix.yml stays, for a different reason

It is the only job that genuinely builds. Single-user Nix cannot set up the build sandbox on ubuntu-24.04 (unprivileged user namespaces are AppArmor-restricted), and Nix's sandbox-fallback defaults to true — it would disable the sandbox and retry rather than fail, silently publishing unsandboxed builds to a public binary cache. The installer is also only ~14% of a network-bound run there.

Note on measurement

This PR run only exercises check.yml; docs.yml triggers on push to main, so its number lands at merge. The projected ~19s saving there is inference from the table above, not an observed CI run.

Relates to the open question in tb-e6v: "Fixed per-job overhead (nix-installer + cachix-action setup) and whether runner sizing is worth revisiting."

docs.yml's build job spent more time installing Nix than doing its work:
23-26s on DeterminateSystems/nix-installer-action against 8-9s of `nix
eval` and ~3s of pip, in a 40-47s job. It builds nothing at all, so the
multi-user daemon and 32 nixbld users it stands up are pure overhead.
nixbuild/nix-quick-install-action unpacks a single-user Nix in ~1s.

check.yml and cachix.yml deliberately keep the Determinate installer,
for two different reasons, both now recorded in the workflows.

check.yml was swapped too and measured worse, so it is reverted here.
nix-installer-action installs *Determinate* Nix, whose parallel
evaluator this flake's cross-system forcing exercises directly. Upstream
Nix 2.34.7 from the fast installer took `nix flake check` from ~30s to
60s: 7s saved on install, 30s lost on evaluation, 67s against a 42-48s
baseline. docs.yml wins the same trade because its evaluation is 8-9s
rather than 30s, so doubling it still costs less than the install saves.

cachix.yml is the only job that genuinely builds. Single-user Nix cannot
set up the build sandbox on ubuntu-24.04, where unprivileged user
namespaces are AppArmor-restricted, and Nix's sandbox-fallback defaults
to true — it would disable the sandbox and retry rather than fail,
silently publishing unsandboxed builds to a public binary cache.
@sigma
sigma force-pushed the ci/quick-install-nix branch from e125fec to b90ea10 Compare September 7, 2026 08:54
@sigma sigma changed the title ci: install Nix with nix-quick-install-action in the eval-only jobs ci: install Nix with nix-quick-install-action in the docs job Sep 7, 2026
@sigma
sigma merged commit 2a7735a into main Sep 7, 2026
1 check passed
@sigma
sigma deleted the ci/quick-install-nix branch September 7, 2026 08:56
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