-
Notifications
You must be signed in to change notification settings - Fork 2
/
zshenv
100 lines (79 loc) · 2.6 KB
/
zshenv
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
88
89
90
91
92
93
94
95
96
97
98
99
100
# Don't call compinit on /etc/zsh/zshrc source
skip_global_compinit=1
_add_to_path() {
local dir=${1}
if [[ -d ${dir} && ! ${PATH} =~ (:|^)${dir}(:|$) ]]; then
if [[ ${dir} =~ ^/home ]]; then
export PATH=${dir}${PATH:+:}${PATH}
else
export PATH=${PATH}${PATH:+:}${dir}
fi
fi
}
_try_source() {
local file_path=${1}
if [[ -f ${file_path} ]]; then
source "${file_path}"
fi
}
_add_to_path "/sbin"
_add_to_path "/snap/bin"
_add_to_path "${HOME}/bin"
_add_to_path "${HOME}/.local/bin"
_add_to_path "${HOME}/scripts"
# Pkgsrc paths
_add_to_path "/usr/pkg/bin"
_add_to_path "/usr/pkg/sbin"
# PostgreSQL
export PGDATA=/usr/local/pgsql/data
export PGUSER=postgres
_add_to_path "/usr/local/pgsql/bin/"
# Haskell
_add_to_path "${HOME}/.cargo/bin"
_add_to_path "${HOME}/.cabal/bin"
# Golang
export GOPATH="${HOME}/go"
_add_to_path "${GOPATH}/bin"
_add_to_path "${HOME}/.go/bin"
_add_to_path "/usr/local/go/bin"
# Python
export PYENV_ROOT="${HOME}/.pyenv"
_add_to_path "${PYENV_ROOT}/bin"
_add_to_path "${PYENV_ROOT}/shims"
_add_to_path "${HOME}/.poetry/bin"
# Nix
_try_source "${HOME}/.nix-profile/etc/profile.d/nix.sh"
# export NIX_PATH=${HOME}/.nix-defexpr/channels${NIX_PATH:+:}${NIX_PATH}
export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive # src: https://nixos.wiki/wiki/Locales
# Guix
export GUIX_PROFILE="${HOME}/.guix-profile"
_try_source "${GUIX_PROFILE}/etc/profile"
export GUIX_LOCPATH=${GUIX_PROFILE}/lib/locale
export GUIX_GTK3_PATH=${GUIX_PROFILE}/lib/gtk-3.0${GUIX_GTK3_PATH:+:}${GUIX_GTK3_PATH}
export GUIX_PACKAGE_PATH=${HOME}/.dotfiles/guix-packages
_add_to_path "${GUIX_PROFILE}/bin"
_add_to_path "${GUIX_PROFILE}/sbin"
_add_to_path "${HOME}/.config/guix/current/bin"
# Linuxbrew
_add_to_path "${HOME}/.linuxbrew/bin"
# Emacs
_add_to_path "${HOME}/.emacs.d/bin"
_add_to_path "${HOME}/.config/emacs/bin"
# Krew (k8s plugin manager)
_add_to_path "${KREW_ROOT:-$HOME/.krew}/bin"
# Turn on aliases for hosts
export HOSTALIASES=${HOME}/.hosts
# Private settings
_try_source "${HOME}/.dotfiles-private/env.zsh"
# Add snap .desktop files to rofi menu
export XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/local/share:/usr/share}
export XDG_DATA_DIRS=/var/lib/snapd/desktop:${XDG_DATA_DIRS}
export XDG_DATA_DIRS=${HOME}/.local/share:${XDG_DATA_DIRS}
# Better file picker for telegram
export XDG_CURRENT_DESKTOP=gnome
if (( ${+commands[qt5ct]} )); then
export QT_QPA_PLATFORMTHEME=qt5ct
fi
unset -f _add_to_path
unset -f _try_source
# if [ -e /home/lain/.nix-profile/etc/profile.d/nix.sh ]; then . /home/lain/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer