-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_zshenv.tmpl
More file actions
84 lines (71 loc) · 2.35 KB
/
dot_zshenv.tmpl
File metadata and controls
84 lines (71 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
export PATH=$HOME/.local/bin:$HOME/bin:/usr/local/bin:$PATH
export GPG_TTY=$(tty)
function load_brew_env() {
# Load (home)brew
eval "$("$BREW_BINARY" shellenv)"
}
if [[ ! -v BREW_LOADED || "$BREW_LOADED" == "false" ]]; then
DEFER_BREW_LOAD=false
{{ if (eq .chezmoi.os "linux") -}}
BREW_HOME="/home/linuxbrew/.linuxbrew"
{{- else if (eq .chezmoi.os "darwin") -}}
{{ if (eq .chezmoi.arch "arm64") -}}
BREW_HOME="/opt/homebrew"
{{- else }}
BREW_HOME="/usr/local"
{{- end}}
{{- end}}
BREW_BINARY="$BREW_HOME"/bin/brew
if [[ -f "$BREW_BINARY" ]]; then
{{- if (eq .chezmoi.group "devbox") }}
export PATH="$PATH:$BREW_HOME/bin:$BREW_HOME/sbin"
{{- else }}
{{- if (eq .chezmoi.os "darwin") }}
DEFER_BREW_LOAD=true
{{- else }}
load_brew_env
{{- end -}}
{{- end }}
fi
BREW_LOADED=true
fi
# pyenv: make shims available in all shells (fast; no eval)
if [[ -d "$HOME/.pyenv" ]]; then
export PYENV_ROOT="$HOME/.pyenv"
# Put pyenv shims first so `python`/`pip` resolve via pyenv when configured.
case ":$PATH:" in
*":$PYENV_ROOT/shims:"*) ;;
*) export PATH="$PYENV_ROOT/shims:$PATH" ;;
esac
# Ensure the pyenv binary is on PATH as well.
case ":$PATH:" in
*":$PYENV_ROOT/bin:"*) ;;
*) export PATH="$PYENV_ROOT/bin:$PATH" ;;
esac
fi
{{ if (eq .chezmoi.os "linux") -}}
if [[ -x "$HOME/.cargo/bin/cargo" ]] && command -v mold &>/dev/null; then
# Always prefer to use mold as the linker on Linux
export RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold"
fi
{{- end }}
{{ if (eq .chezmoi.os "linux") -}}
{{- if (.chezmoi.kernel.osrelease | lower | contains "microsoft") -}}
# WSL-specific code
if [[ -d "/mnt/c/Users/timor.g/AppData/Local/Programs/Microsoft VS Code/bin/" ]]; then
export PATH="$PATH:/mnt/c/Users/timor.g/AppData/Local/Programs/Microsoft VS Code/bin/"
fi
{{- end }}
{{- end -}}
{{ if .personal.work_env -}}
# Load work environment with caching
if [[ -z "$WORK_ENV_LOADED" ]]; then
if [[ -r "{{ .system.work_generic_dotfiles_profile }}" ]]; then
source {{ .system.work_generic_dotfiles_profile }}
fi
if [[ -n "$WORK_ZSH_ENV_EXTENSION" && -r "$WORK_ZSH_ENV_EXTENSION" ]]; then
source "$WORK_ZSH_ENV_EXTENSION"
fi
export WORK_ENV_LOADED=true
fi
{{- end }}