Skip to content

Commit

Permalink
feat: add alternative priv escalation
Browse files Browse the repository at this point in the history
  • Loading branch information
Liassica committed Aug 18, 2024
1 parent c34f93a commit 6f11fe5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ I've Nixified the upstream glim script, so it should work out of the box on syst

Follow the upstream instructions for setting up your USB device.

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.
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.

E.g, to use the Breeze GRUB theme:

Expand Down
13 changes: 12 additions & 1 deletion nix/package/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,25 @@ writeShellScriptBin "glim" ''
grub2_efi
rsync
]
}:$PATH
}:''$PATH
# Check that we are *NOT* running as root
if [[ `id -u` -eq 0 ]]; then
echo "ERROR: Don't run as root, use a user with full sudo access."
exit 1
fi
# Use alternative if sudo is not found
if [[ ! `which sudo &>/dev/null` ]]; then
if which doas &>/dev/null; then
alias sudo=doas
else
sudo () {
su -c "$*"
}
fi
fi
# Find GLIM device (use the first if multiple found, you've asked for trouble!)
USBDEV1=`blkid -L GLIM | head -n 1`
Expand Down

0 comments on commit 6f11fe5

Please sign in to comment.