Skip to content

Commit

Permalink
Merge pull request #105 from cachix/resilient-install
Browse files Browse the repository at this point in the history
Resilient installation
  • Loading branch information
domenkozar authored Nov 11, 2021
2 parents b93cdea + 783053e commit 489b4a2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/install-nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 489b4a2

Please sign in to comment.