# DO NOT RESET PATH. # The trick here is to ensure that these directories are added # as soon as possible, such that later shells can override. # It is assumed that the system paths are already present at this point. # Order is important here. Paths are prefixed to be able to override # system paths, so put high priority last. # optional for dir in \ $HOME/.local/bin \ $HOME/.cabal/bin \ $HOME/.cargo/bin \ $HOME/.npm-global \ /etc/net/bin \ $HOME/bin do if [ -d "$dir" ]; then if echo "$PATH" | grep -F -v "$dir" >/dev/null; then # echo "add $dir" >&2 PATH="$dir:$PATH" # else # echo "have $dir" >&2 fi # else # echo "nodir $dir" fi done if echo "$PATH" | grep -v -F .nix-profile >/dev/null; then NIX_SH=~/.nix-profile/etc/profile.d/nix.sh [ -f $NIX_SH ] && . $NIX_SH fi export PATH