Skip to content

Commit 9787e74

Browse files
committed
Install Nix: add initializeDB()
rm old message installing Nix database rm old nix-store --init initialization rm old ! nix-store --load-db
1 parent 945e6e6 commit 9787e74

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

scripts/install-nix-from-closure.sh

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -677,21 +677,30 @@ installNix() {
677677
done
678678
printf '\n'
679679
}
680+
681+
initializeDB() {
682+
notice "
683+
684+
Initializing Nix database...
685+
"
686+
if ! "$nix/bin/nix-store" --init; then
687+
error "
688+
689+
Failed to initialize the Nix database
690+
"
691+
fi
692+
693+
if ! "$nix/bin/nix-store" --load-db < "$self/.reginfo"; then
694+
error "
695+
696+
Unable to register valid paths
697+
"
698+
fi
699+
}
680700
}
681701

682702
}
683703
echo "performing a single-user installation of Nix..." >&2
684-
echo "initialising Nix database..." >&2
685-
if ! $nix/bin/nix-store --init; then
686-
echo "$0: failed to initialize the Nix database" >&2
687-
exit 1
688-
fi
689-
690-
if ! "$nix/bin/nix-store" --load-db < "$self/.reginfo"; then
691-
echo "$0: unable to register valid paths" >&2
692-
exit 1
693-
fi
694-
695704
. "$nix/etc/profile.d/nix.sh"
696705

697706
if ! "$nix/bin/nix-env" -i "$nix"; then

0 commit comments

Comments
 (0)