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:
parent
b7e8a3bf4c
commit
012a913fbc
|
@ -137,7 +137,7 @@ echo "performing a single-user installation of Nix..." >&2
|
||||||
if ! [ -e "$dest" ]; then
|
if ! [ -e "$dest" ]; then
|
||||||
cmd="mkdir -m 0755 $dest && chown $USER $dest"
|
cmd="mkdir -m 0755 $dest && chown $USER $dest"
|
||||||
echo "directory $dest does not exist; creating it by running '$cmd' using sudo" >&2
|
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
|
echo "$0: please manually run '$cmd' as root to create $dest" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue