fix: pre-create /nix before nix installer in Docker (no sudo available)

This commit is contained in:
mozempk
2026-04-23 14:54:29 +02:00
parent b2c2311dd2
commit dcde299b45

View File

@@ -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