fix: pre-create /nix before nix installer in Docker (no sudo available)
This commit is contained in:
@@ -61,7 +61,11 @@ if [[ -n "${NIX_PACKAGES_PREBAKE:-}" ]]; then
|
||||
else
|
||||
echo " installing nix (single-user, no-daemon)..."
|
||||
rm -rf /nix ~/.nix-profile ~/.nix-defexpr ~/.nix-channels
|
||||
curl -fsSL https://nixos.org/nix/install | sh -s -- --no-daemon --no-channel-add
|
||||
# Pre-create /nix as root so the installer doesn't try 'sudo mkdir'
|
||||
# (sudo isn't installed in this Docker container).
|
||||
mkdir -m 0755 -p /nix
|
||||
curl -fsSL https://nixos.org/nix/install | \
|
||||
NIX_INSTALLER_TRUST_INSTALLER=1 sh -s -- --no-daemon --no-channel-add
|
||||
# shellcheck disable=SC1091
|
||||
. /root/.nix-profile/etc/profile.d/nix.sh
|
||||
|
||||
|
||||
Reference in New Issue
Block a user