-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zprofile.tmpl
87 lines (73 loc) · 2.65 KB
/
dot_zprofile.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
# -*-mode:sh-*- vim:ft=zsh
# ~/.zprofile
# --------------------
# Loaded at *login shells*
#
# Focuses on system-level environment. This file is for essential
# environment variables.
#
# Close shell with five presses of CTRL-D
export IGNOREEOF=5
export LANG=en_US.UTF-8
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
# Load app configurations from separate configuration file.
if [[ -a "$HOME"/.bash_secrets ]]; then
source "$HOME"/.bash_secrets
fi
# Homebrew installs to its preferred prefix;
# - /usr/local for macOS Intel
# - /opt/homebrew for Apple Silicon
# - /home/linuxbrew/.linuxbrew for Linux
eval "$(/opt/homebrew/bin/brew shellenv)"
export PATH="$(brew --prefix python3)/bin:$PATH"
if [[ -f "$HOME/google-cloud-sdk/completion.zsh.inc" ]]; then
# Enable shell command completion for gcloud.
source "$HOME/google-cloud-sdk/path.zsh.inc"
source "$HOME/google-cloud-sdk/completion.zsh.inc"
fi
if (( ${+commands[cs]} )); then
# Scala application manager
# Add coursier bin directory to PATH
eval "$(cs install --env)"
# Define JAVA_HOME and add it to the PATH. Assign existing JAVA_HOME to CS_FORMER_JAVA_HOME
{{ if (eq .chezmoi.username .chezmoi.config.data.work_username )}}
JAVA_HOME="$(cs java-home --architecture arm64 --jvm {{ .chezmoi.config.data.work_java_version }})"
{{ else }}
JAVA_HOME="$(cs java-home --architecture arm64 --jvm {{ .chezmoi.config.data.sys_java_version }})"
{{ end }}
export PATH="$JAVA_HOME/bin:$PATH"
fi
if (( ${+commands[lefthook]} )); then
export LEFTHOOK_HOME="$(brew --prefix lefthook)"
export PATH="$LEFTHOOK_HOME/bin:$PATH"
fi
# The preferred pager
if (( ${+commands[moar]} )); then
export PAGER='moar'
fi
export NVIM_SESSION="$XDG_CONFIG_HOME/nvim/session"
export EDITOR='nvim'
export VISUAL='nvim'
#
# The preferred visual editor for local or set the remote
# visual editor. The EDITOR variable technically shouldn't be set to a
# "visual" editor like vi but something like ed
#
if (( ${+commands[zed]} )) && [[ -n $SSH_CONNECTION ]]; then
export VISUAL='zed --wait --new'
fi
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
# MacOS alerting from terminal
# https://github.com/vjeantet/alerter?tab=readme-ov-file
if [[ -f /opt/alerter/bin/alerter ]]; then
export PATH="$PATH:/opt/alerter/bin"
fi
{{ if (eq .chezmoi.username .chezmoi.config.data.work_username)}}
# Gaurded by one password
export NEW_RELIC_API_KEY={{ range (onepassword "eehrc6lejvajtfcpejah3e5uem").fields -}}
{{ if (eq .id "credential") -}}
{{ .value -}}
{{ end -}}
{{ end }}
{{ end }}