Make a root single user nix install possible
Taken from this issue https://github.com/NixOS/nix/issues/1559 This is only so that the script will succeed when running in docker containers without systemd (can't use multi-user) and that have root as the default user, a shockingly common practice
This commit is contained in:
parent
39a666c7b7
commit
4d5084e5aa
@ -11,6 +11,12 @@ if [ -d /nix ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Workaround to make a single user install work as root
|
||||||
|
if [ "${USER:-}" == "root" ] || [ "${UID:-}" == "0" ]; then
|
||||||
|
mkdir -p /etc/nix
|
||||||
|
echo "build-users-group =" > /etc/nix/nix.conf
|
||||||
|
fi
|
||||||
|
|
||||||
# Download the Nix installer and it's signature from NixOS.org
|
# Download the Nix installer and it's signature from NixOS.org
|
||||||
curl -so install-nix https://releases.nixos.org/nix/nix-2.18.1/install
|
curl -so install-nix https://releases.nixos.org/nix/nix-2.18.1/install
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user