Skip to content

Commit

Permalink
Allow using doas in place of sudo.
Browse files Browse the repository at this point in the history
doas is much smaller and is used by some distributions, such as
Alpine, instead of sudo.
  • Loading branch information
shlevy committed Feb 27, 2024
1 parent fb27d67 commit 5e020ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/nixos-anywhere.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5e020ab

Please sign in to comment.