Enable always-allow-substitutes by default

A typical CI machine will have fast internet access, but may not have
all the inputs already in the store to rebuild trivial derivations
marked with `allowSubstitutes = false`. This leads to expensive cycles
of downloads and rebuilds for derivations like the top-level NixOS
system, which will be rebuilt from scratch on every CI run, despite
being cached.
This commit is contained in:
Sander 2024-05-14 21:19:49 +00:00
parent 8887e596b4
commit 859c1e74ef
No known key found for this signature in database
GPG key ID: D1A763BC84F34603

View file

@ -56,6 +56,11 @@ fi
if [[ ! $INPUT_EXTRA_NIX_CONFIG =~ "experimental-features" ]]; then
add_config "experimental-features = nix-command flakes"
fi
# Always allow substituting from the cache, even if the derivation has `allowSubstitutes = false`.
# This is a CI optimisation to avoid having to download the inputs for already-cached derivations to rebuild trivial text files.
if [[ ! $INPUT_EXTRA_NIX_CONFIG =~ "always-allow-substitutes" ]]; then
add_config "always-allow-substitutes = true"
fi
# Nix installer flags
installer_options=(