Skip to content

Commit 6f11fe5

Browse files
committed
feat: add alternative priv escalation
thias#123
1 parent c34f93a commit 6f11fe5

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ I've Nixified the upstream glim script, so it should work out of the box on syst
1010

1111
Follow the upstream instructions for setting up your USB device.
1212

13-
Then, install glim to your USB by running `nix run github:Liassica/glim-flake`. You can override the theme by adding this repo as a flake input and overriding the 'theme' input.
13+
Then, install glim to your USB by running `nix run github:Liassica/glim-flake`. You can override the theme or by adding this repo as a flake input and overriding the 'theme' input.
1414

1515
E.g, to use the Breeze GRUB theme:
1616

nix/package/default.nix

+12-1
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,25 @@ writeShellScriptBin "glim" ''
1818
grub2_efi
1919
rsync
2020
]
21-
}:$PATH
21+
}:''$PATH
2222
2323
# Check that we are *NOT* running as root
2424
if [[ `id -u` -eq 0 ]]; then
2525
echo "ERROR: Don't run as root, use a user with full sudo access."
2626
exit 1
2727
fi
2828
29+
# Use alternative if sudo is not found
30+
if [[ ! `which sudo &>/dev/null` ]]; then
31+
if which doas &>/dev/null; then
32+
alias sudo=doas
33+
else
34+
sudo () {
35+
su -c "$*"
36+
}
37+
fi
38+
fi
39+
2940
# Find GLIM device (use the first if multiple found, you've asked for trouble!)
3041
USBDEV1=`blkid -L GLIM | head -n 1`
3142

0 commit comments

Comments
 (0)