Skip to content

Commit

Permalink
Resilient installation
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Nov 11, 2021
1 parent fe464fe commit 783053e
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 @@ -45,7 +45,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 783053e

Please sign in to comment.