mirror of
https://github.com/cachix/install-nix-action.git
synced 2024-11-27 02:43:58 +00:00
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:
parent
8887e596b4
commit
859c1e74ef
1 changed files with 5 additions and 0 deletions
|
@ -56,6 +56,11 @@ fi
|
||||||
if [[ ! $INPUT_EXTRA_NIX_CONFIG =~ "experimental-features" ]]; then
|
if [[ ! $INPUT_EXTRA_NIX_CONFIG =~ "experimental-features" ]]; then
|
||||||
add_config "experimental-features = nix-command flakes"
|
add_config "experimental-features = nix-command flakes"
|
||||||
fi
|
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
|
# Nix installer flags
|
||||||
installer_options=(
|
installer_options=(
|
||||||
|
|
Loading…
Reference in a new issue