mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-03-03 11:58:02 +00:00
Moved path variables to single-source-of-truth
This commit is contained in:
23
dot_bashrc
23
dot_bashrc
@@ -30,20 +30,15 @@ export LESS_TERMCAP_se=$'\e[0m'
|
||||
export LESS_TERMCAP_us=$'\e[00;36m'
|
||||
export LESS_TERMCAP_ue=$'\e[0m'
|
||||
|
||||
path_prepend() {
|
||||
if [ -d "$1" ]; then
|
||||
export PATH="$1:$PATH"
|
||||
fi
|
||||
}
|
||||
|
||||
path_prepend "/opt/miniconda3/bin"
|
||||
path_prepend "/nix/var/nix/profiles/default/bin"
|
||||
path_prepend "$HOME/.nix-profile/bin"
|
||||
path_prepend "$HOME/.ghcup/bin"
|
||||
path_prepend "$HOME/.poetry/bin"
|
||||
path_prepend "$HOME/.cargo/bin"
|
||||
path_prepend "$HOME/.local/bin"
|
||||
unset -f path_prepend
|
||||
if [ -f ~/.config/path.env ]; then
|
||||
while read -r line; do
|
||||
[[ -z "$line" || "$line" == #* ]] && continue
|
||||
p=$(eval echo "$line")
|
||||
if [ -d "$p" ]; then
|
||||
export PATH="$p:$PATH"
|
||||
fi
|
||||
done < ~/.config/path.env
|
||||
fi
|
||||
|
||||
# --- Aliases ---
|
||||
# Modern Unix Replacements
|
||||
|
||||
@@ -20,10 +20,8 @@ set -gx LESS_TERMCAP_se (printf "\e[0m")
|
||||
set -gx LESS_TERMCAP_us (printf "\e[00;36m")
|
||||
set -gx LESS_TERMCAP_ue (printf "\e[0m")
|
||||
|
||||
fish_add_path ~/.local/bin
|
||||
fish_add_path ~/.cargo/bin
|
||||
fish_add_path ~/.poetry/bin
|
||||
fish_add_path ~/.ghcup/bin
|
||||
fish_add_path ~/.nix-profile/bin
|
||||
fish_add_path /nix/var/nix/profiles/default/bin
|
||||
fish_add_path /opt/miniconda3/bin
|
||||
if test -f ~/.config/path.env
|
||||
for dir in (cat ~/.config/path.env)
|
||||
eval fish_add_path -m $dir
|
||||
end
|
||||
end
|
||||
|
||||
@@ -76,7 +76,7 @@ $env.PATH = (
|
||||
$env.PATH
|
||||
| split row (char esep)
|
||||
| append (
|
||||
open ($env.FILE_PWD | path join "path.env")
|
||||
open ($env.XDG_CONFIG_HOME | path join "path.env")
|
||||
| from csv --noheaders --trim all
|
||||
| get "column0"
|
||||
| path expand --no-symlink
|
||||
|
||||
20
dot_zshrc
20
dot_zshrc
@@ -23,18 +23,16 @@ export LESS_TERMCAP_us=$'\e[00;36m'
|
||||
export LESS_TERMCAP_ue=$'\e[0m'
|
||||
|
||||
# --- Path Configuration ---
|
||||
if [[ -f ~/.config/path.env ]]; then
|
||||
for dir in $(cat ~/.config/path.env); do
|
||||
expanded_dir=${~dir}
|
||||
if [[ -d $expanded_dir ]]; then
|
||||
path=($expanded_dir $path)
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
typeset -U path
|
||||
path=(
|
||||
/opt/miniconda3/bin
|
||||
/nix/var/nix/profiles/default/bin
|
||||
$HOME/.nix-profile/bin
|
||||
$HOME/.ghcup/bin
|
||||
$HOME/.poetry/bin
|
||||
$HOME/.cargo/bin
|
||||
$HOME/.local/bin
|
||||
$path
|
||||
)
|
||||
export PATH
|
||||
|
||||
# --- Zsh Settings ---
|
||||
HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh_history"
|
||||
|
||||
Reference in New Issue
Block a user