Merge pull request #105 from cachix/resilient-install

Resilient installation
This commit is contained in:
Domen Kožar 2021-11-11 16:25:04 -06:00 committed by GitHub
commit 489b4a2f78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,15 @@ if [[ $INPUT_INSTALL_OPTIONS != "" ]]; then
fi
echo "installer options: ${installer_options[@]}"
sh <(curl --retry 5 --retry-connrefused -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}") "${installer_options[@]}"
# There is --retry-on-errors, but only newer curl versions support that
until curl -o /tmp/install -v --fail --retry 5 --retry-connrefused -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}"
do
sleep 1
done
chmod +x /tmp/install
sh /tmp/install "${installer_options[@]}"
if [[ $OSTYPE =~ darwin ]]; then
# macOS needs certificates hints