Skip to content

Commit

Permalink
Retry if db registration fails
Browse files Browse the repository at this point in the history
  • Loading branch information
rickynils committed Mar 15, 2024
1 parent 483e6ef commit b35ae20
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nix-quick-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,15 @@ fi

# Populate the nix db
nix="$(readlink /nix/var/nix-quick-install-action/nix)"
"$nix/bin/nix-store" --load-db < /nix/var/nix-quick-install-action/registration
retries=2
while true; do
"$nix/bin/nix-store" \
--load-db < /nix/var/nix-quick-install-action/registration && break || true
((i--))
echo >&2 "Retrying Nix DB registration"
sleep 2
done


# Install nix in profile
MANPATH= . "$nix/etc/profile.d/nix.sh"
Expand Down

0 comments on commit b35ae20

Please sign in to comment.