1
1
Fork 0

sudo: add confirmation prompt

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2024-12-06 19:44:03 -06:00
parent de8f54ead2
commit 63fc603f07
Signed by: Myned
GPG key ID: C7224454F7881A34

View file

@ -1,6 +1,7 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
@ -25,5 +26,21 @@ in {
'';
};
};
environment.shellAliases = {
# Sudo confirmation prompt
sudo = pkgs.writeShellScript "sudo" ''
read -p "Execute as root? [Y/n] "
case "$REPLY" in
"" | [Yy])
command sudo "$@"
;;
*)
exit 1
;;
esac
'';
};
};
}