1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-19 10:50:24 -04:00

Add doas support to the installation script.

Previously the install errored out and told you to manually add `/nix/` and set the perms if you had `doas` installed instead of `sudo`. Well, not any more!
This commit is contained in:
ForeverNooob 2022-10-30 08:13:19 +00:00 committed by GitHub
parent b7e8a3bf4c
commit 012a913fbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -137,7 +137,7 @@ echo "performing a single-user installation of Nix..." >&2
if ! [ -e "$dest" ]; then
cmd="mkdir -m 0755 $dest && chown $USER $dest"
echo "directory $dest does not exist; creating it by running '$cmd' using sudo" >&2
if ! sudo sh -c "$cmd"; then
if ! (sudo sh -c "$cmd" || doas sh -c "$cmd") ; then
echo "$0: please manually run '$cmd' as root to create $dest" >&2
exit 1
fi