diff --git a/nix/package/default.nix b/nix/package/default.nix index 2b07850..713bff7 100644 --- a/nix/package/default.nix +++ b/nix/package/default.nix @@ -26,6 +26,19 @@ writeShellScriptBin "glim" '' exit 1 fi + # Use alternative if sudo is not found + if [[ ! `which sudo &>/dev/null` ]]; then + if which doas &>/dev/null; then + 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`