Skip to content

Commit 489b4a2

Browse files
authored
Merge pull request #105 from cachix/resilient-install
Resilient installation
2 parents b93cdea + 783053e commit 489b4a2

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
@@ -47,7 +47,15 @@ if [[ $INPUT_INSTALL_OPTIONS != "" ]]; then
4747
fi
4848

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

5260
if [[ $OSTYPE =~ darwin ]]; then
5361
# macOS needs certificates hints

0 commit comments

Comments
 (0)