1
0
Fork 0

bashrc: have a sudo alias on non-NixOS systems where Nix is installed

This commit is contained in:
Pratham Patel 2024-04-18 16:44:43 +05:30
parent 42de7d9c83
commit 1198272d52
Signed by: thefossguy
SSH Key Fingerprint: SHA256:HwRBy9H1FYXWcv/Qi1WY3kmcVtGz2ydZuPJgD4pkusY
1 changed files with 5 additions and 0 deletions

View File

@ -49,6 +49,10 @@ if [[ "$(uname -s)" == 'Linux' ]]; then
EDITOR=vim
FILES_TO_SOURCE+=("${HOME}/.nix-profile/etc/profile.d/hm-session-vars.sh")
if command -v nix > /dev/null; then
alias sudo='sudo --preserve-env=PATH env'
fi
if grep 'debian' /etc/os-release > /dev/null; then
export NEEDRESTART_MODE='a'
export DEBIAN_FRONTEND='noninteractive'
@ -71,6 +75,7 @@ elif [[ "$(uname -s)" == 'Darwin' ]]; then
alias ktb='sudo pkill TouchBarServer; sudo killall ControlStrip'
alias mpv='mpv --vo=libmpv'
alias ownefivars="chmod +uw ${HOME}/Library/Containers/com.utmapp.UTM/Data/Documents/*.utm/Data/efi_vars.fd"
alias sudo='sudo --preserve-env=PATH env'
path_add '/usr/local/bin'
fi