mirror of
https://github.com/numtide/nixos-anywhere.git
synced 2024-10-26 21:08:56 +03:00
Allow using doas in place of sudo.
doas is much smaller and is used by some distributions, such as Alpine, instead of sudo.
This commit is contained in:
parent
3572a7c47e
commit
31c945ed58
@ -317,6 +317,7 @@ is_installer=\$(if [[ "\$is_nixos" == "y" ]] && grep -q VARIANT_ID=installer /et
|
||||
is_container=\$(if [[ "\$(has systemd-detect-virt)" == "y" ]]; then systemd-detect-virt --container; else echo "none"; fi)
|
||||
has_tar=\$(has tar)
|
||||
has_sudo=\$(has sudo)
|
||||
has_doas=\$(has doas)
|
||||
has_wget=\$(has wget)
|
||||
has_curl=\$(has curl)
|
||||
has_setsid=\$(has setsid)
|
||||
@ -348,6 +349,8 @@ fi
|
||||
maybe_sudo=""
|
||||
if [[ ${has_sudo-n} == "y" ]]; then
|
||||
maybe_sudo="sudo"
|
||||
elif [[ ${has_doas-n} == "y" ]]; then
|
||||
maybe_sudo="doas"
|
||||
fi
|
||||
|
||||
if [[ ${is_os-n} != "Linux" ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user