fix(distrobox): Remove nix
from $PATH when in Distrobox container
This commit is contained in:
parent
98a327eb13
commit
8f57a2b282
1 changed files with 19 additions and 12 deletions
31
zsh.nix
31
zsh.nix
|
@ -34,6 +34,12 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
|
# Remove nix from path if we are in a container (distrobox)
|
||||||
|
if [ -v DISTROBOX_ENTER_PATH ]; then
|
||||||
|
export PATH=$(echo $PATH | tr ':' '\n' | grep -vE '/nix/|/run/wrappers|\.nix-profile|/etc/profiles/per-user/jirka/bin|/run/current-system/sw/bin' | tr '\n' ':')
|
||||||
|
export PATH=$(echo $PATH | sed 's/:$//')
|
||||||
|
fi
|
||||||
|
|
||||||
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||||
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
||||||
# case $(tty) in
|
# case $(tty) in
|
||||||
|
@ -104,6 +110,19 @@
|
||||||
alias put="kitty +kitten transfer --direction=upload"
|
alias put="kitty +kitten transfer --direction=upload"
|
||||||
alias kclip="kitty +kitten clipboard"
|
alias kclip="kitty +kitten clipboard"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Special aliases that may not work with Nix config
|
||||||
|
# Command line head / tail shortcuts
|
||||||
|
alias H="| head";
|
||||||
|
alias T="| tail";
|
||||||
|
alias G="| grep";
|
||||||
|
alias L="| less";
|
||||||
|
alias M="| most";
|
||||||
|
alias LL="2>&1 | less";
|
||||||
|
alias CA="2>&1 | cat -A";
|
||||||
|
alias NE="2> /dev/null";
|
||||||
|
alias NUL="> /dev/null 2>&1";
|
||||||
|
alias P="2>&1| pygmentize -l pytb";
|
||||||
'';
|
'';
|
||||||
|
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
|
@ -126,18 +145,6 @@
|
||||||
|
|
||||||
t="tail -f";
|
t="tail -f";
|
||||||
|
|
||||||
# Command line head / tail shortcuts
|
|
||||||
H="| head";
|
|
||||||
T="| tail";
|
|
||||||
G="| grep";
|
|
||||||
L="| less";
|
|
||||||
M="| most";
|
|
||||||
LL="2>&1 | less";
|
|
||||||
CA="2>&1 | cat -A";
|
|
||||||
NE="2> /dev/null";
|
|
||||||
NUL="> /dev/null 2>&1";
|
|
||||||
P="2>&1| pygmentize -l pytb";
|
|
||||||
|
|
||||||
dud="du -d 1 -h";
|
dud="du -d 1 -h";
|
||||||
duf="du -sh *";
|
duf="du -sh *";
|
||||||
# fd="find . -type d -name";
|
# fd="find . -type d -name";
|
||||||
|
|
Loading…
Reference in a new issue