-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshenv.tmpl
87 lines (75 loc) · 2.3 KB
/
dot_zshenv.tmpl
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
85
86
87
# Zsh options
unsetopt GLOBAL_RCS
setopt INC_APPEND_HISTORY
# Base Directories
CONFIG_DIR=${HOME}/.config
STATE_DIR="${HOME}/.local/state"
CACHE_DIR="${HOME}/.cache"
NIX_STATE_DIR="${HOME}/.local/state/nix"
NIX_PROFILE_DIR="${NIX_STATE_DIR}/profile"
export CARGO_HOME="${CONFIG_DIR}/cargo"
export RUSTUP_HOME="${CONFIG_DIR}/rustup"
export GOPATH="${STATE_DIR}/go"
export GOCACHE="${CACHE_DIR}/go/build"
export GOMODCACHE="${CACHE_DIR}/go/mod"
export GOTOOLCHAIN="local"
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALL_CLEANUP=1
export HOMEBREW_CASK_OPTS="--no-quarantine"
export HOMEBREW_GITHUB_API_TOKEN={{ .github.token }}
export HOMEBREW_UPGRADE_GREEDY=1
export NPM_CONFIG_USERCONFIG="${CONFIG_DIR}/npm/npmrc"
export PNPM_HOME="${STATE_DIR}/pnpm"
export REDISCLI_HISTFILE="${STATE_DIR}/redis/history"
export WGETRC="${CONFIG_DIR}/wgetrc"
export VSCE_PAT={{ .vsce.token }}
export GITHUB_TOKEN={{ .github.token }}
export ETCDCTL_API=3
export NIXPKGS_ALLOW_INSECURE=1
export NIXPKGS_ALLOW_UNFREE=1
export PYTHONSTARTUP="${CONFIG_DIR}/python/pythonrc"
if [[ -z "$TERMINFO" ]]; then
export TERMINFO="${STATE_DIR}/terminfo"
fi
export VSC_REST_CLIENT_HOME="${STATE_DIR}/rest-client"
export MYSQLSH_USER_CONFIG_HOME="${CONFIG_DIR}/mysqlsh"
export KUBECONFIG="${CONFIG_DIR}/kube"
export KUBECACHEDIR="${CACHE_DIR}/kube"
{{ if .proxy_enabled -}}
export HTTP_PROXY=http://127.0.0.1:7890
export HTTPS_PROXY=http://127.0.0.1:7890
export ALL_PROXY=socks5://127.0.0.1:7890
export http_proxy=http://127.0.0.1:7890
export https_proxy=http://127.0.0.1:7890
export all_proxy=socks5://127.0.0.1:7890
{{ end -}}
# Paths
typeset -U PATH path
BIN_DIRS=(
"${CARGO_HOME}/bin"
"${GOPATH}/bin"
)
for BIN_DIR in ${BIN_DIRS[@]}; do
if [ -d "${BIN_DIR}" ]; then
PATH="${BIN_DIR}:${PATH}"
fi
done
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
export NIX_PATH="${NIX_STATE_DIR}/defexpr/channels"
fi
{{ if eq .chezmoi.os "darwin" -}}
# Homebrew
{{ if eq .chezmoi.arch "arm64" -}}
if [ -f /opt/homebrew/bin/brew ]; then
eval $(/opt/homebrew/bin/brew shellenv)
fi
PATH="/usr/local/bin:${PATH}"
{{ else -}}
if [ -f /usr/local/bin/brew ]; then
eval $(/usr/local/bin/brew shellenv)
fi
{{ end }}
PATH="/usr/local/bin:${PATH}"
{{ end -}}