Skip to content

Commit 03058e6

Browse files
committed
nixos-anywhere: support run0
1 parent 8ecb12e commit 03058e6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ hasTar=
5454
hasCpio=
5555
hasSudo=
5656
hasDoas=
57+
hasRun0=
5758
hasWget=
5859
hasCurl=
5960
hasSetsid=
@@ -528,7 +529,7 @@ importFacts() {
528529

529530
# Necessary to prevent Bash erroring before printing out which fact had an issue
530531
set +u
531-
for var in isOs isArch isInstaller isContainer isRoot hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid; do
532+
for var in isOs isArch isInstaller isContainer isRoot hasIpv6Only hasTar hasCpio hasSudo hasDoas hasRun0 hasWget hasCurl hasSetsid; do
532533
if [[ -z ${!var} ]]; then
533534
abort "Failed to retrieve fact $var from host"
534535
fi
@@ -541,9 +542,11 @@ importFacts() {
541542
maybeSudo=sudo
542543
elif [[ ${hasDoas} == "y" ]]; then
543544
maybeSudo=doas
545+
elif [[ ${hasRun0} == "y" ]]; then
546+
maybeSudo=run0
544547
else
545548
# shellcheck disable=SC2016
546-
abort 'Unable to find a command to use to escalate privileges: Could not find `sudo` or `doas`'
549+
abort 'Unable to find a command to use to escalate privileges: Could not find `sudo`, `doas` or `run0`'
547550
fi
548551
}
549552

0 commit comments

Comments
 (0)