Skip to content

Commit 783053e

Browse files
committed
Resilient installation
1 parent fe464fe commit 783053e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/install-nix.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,15 @@ if [[ $INPUT_INSTALL_OPTIONS != "" ]]; then
4545
fi
4646

4747
echo "installer options: ${installer_options[@]}"
48-
sh <(curl --retry 5 --retry-connrefused -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}") "${installer_options[@]}"
48+
49+
# There is --retry-on-errors, but only newer curl versions support that
50+
until curl -o /tmp/install -v --fail --retry 5 --retry-connrefused -L "${INPUT_INSTALL_URL:-https://nixos.org/nix/install}"
51+
do
52+
sleep 1
53+
done
54+
55+
chmod +x /tmp/install
56+
sh /tmp/install "${installer_options[@]}"
4957

5058
if [[ $OSTYPE =~ darwin ]]; then
5159
# macOS needs certificates hints

0 commit comments

Comments
 (0)