Skip to content

Commit 84da883

Browse files
committed
support run0 as a sudo alternative
1 parent c700f35 commit 84da883

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/get-facts.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ hasTar=$(has tar)
1616
hasCpio=$(has cpio)
1717
hasSudo=$(has sudo)
1818
hasDoas=$(has doas)
19+
hasRun0=$(has run0)
1920
hasWget=$(has wget)
2021
hasCurl=$(has curl)
2122
hasSetsid=$(has setsid)

src/nixos-anywhere.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ hasTar=
5050
hasCpio=
5151
hasSudo=
5252
hasDoas=
53+
hasRun0=
5354
hasWget=
5455
hasCurl=
5556
hasSetsid=
@@ -474,7 +475,7 @@ importFacts() {
474475
# shellcheck disable=SC2046
475476
export $(echo "$filteredFacts" | xargs)
476477

477-
for var in isOs isArch isKexec isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid; do
478+
for var in isOs isArch isKexec isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasRun0 hasWget hasCurl hasSetsid; do
478479
if [[ -z ${!var} ]]; then
479480
abort "Failed to retrieve fact $var from host"
480481
fi
@@ -772,6 +773,8 @@ main() {
772773
maybeSudo="sudo"
773774
elif [[ ${hasDoas-n} == "y" ]]; then
774775
maybeSudo="doas"
776+
elif [[ ${hasRun0-n} == "y" ]]; then
777+
maybeSudo="run0"
775778
fi
776779
777780
if [[ ${isOs} != "Linux" ]]; then

0 commit comments

Comments
 (0)