-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshenv
342 lines (273 loc) · 14.2 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# -*- mode: sh -*-
#### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## File: $HOME/.zshenv
## Global Multiplatform ZSH Configs for: Non Interactive Shells...
## Created: 2019-001-24
## Modified: 2020-002-02
## Author: Alisha Awen - [email protected]
## Git Username: harmonicalchemy
## Ref: https://www.zsh.org/
## Repo: Github.com:harmonicalchemy/pDotfiles.git
## Environment: Linux, BSD, (Qubes 4.0 App VMs) and Mac OS
## (not for hosted VPS or bare metal servers)
##
## $HOME/.zshenv is always sourced by ZSH upon startup, (all modes)...
## This file is also sourced first before any of the other config files...
## Therefore this file is an excellent place to define common configs needed for
## all situations. (interactive, non-interactive, login, etc.) $PATH definitions
## (used by all modes) will be set exclusively within this file only...
## No need to duplicate things unnecessarily, which could also cause unexpected
## side effects! Everything else defined here is intended for: NON INTERACTIVE
## use exclusively. Anything that sends output to the screen, or
## expects a human response, should not be defined within this file...
##
## This simple version of Harmonic Alchemy "Dotfiles" does not need to do
## anything fancy like define $ZDOTDIR. Also there is no current need for a
## .zlogin, .zlogout, or .zprofile. _yet_ There are no current plans for these
## extra config files until I reach a more automated dotfiles stage with auto configs
## for remote VPS host environments folded in... First lets get this all working
## great manually...
##
## Please do add/remove definitions depending on your particular machine
## environment(s) but please try to keep the structure and sections below the
## same as they are now... There is a reason for that! Add your custom mods
## within the sections that they belong in. Please don't try to move sections
## around etc. You may break some things! Be careful... Sections are well
## defined below with comment banners for us dumb humans to be able to read...
##
## Change Log: (descending chronological order)
##
## 2020-002-02 - Alisha Awen Sheppard - [email protected]
## Copied this file fresh from .zshenv on my private .DOTFILES repo.
## Performed some security due diligence work for 2020...
##
## 2019-006-26 - Alisha Awen Sheppard - [email protected]
## HUGE OVERHAUL for Mac OS mostly... Also added debug print
## statements... (that will be commented out when not debugging)...
##
## 2019-005-16 - Alisha Awen Sheppard - [email protected]
## This file needed an overhaul after all the troubleshooting over several
## months (both Mac OS and Linux). I cleaned this up and also added some
## settings copied from [vault-pgp] .bash_common which may fix some issues I
## am having trying to get git-remote-gcrypt to work... The structure here
## is now simpler... I hope I did not break anything!
## I am on [MWM-work] now. I will have to test this on Rodrigo next...
## Still no fix for Emacs environment vars problem... Boot from shell works.
##
## 2019-003-16 - Alisha Awen Sheppard - [email protected]
## While I am troubleshooting Mac OS problems, I am now trying this on my
## older Macbook Pro to see how things go with Mac OS El Capitan, which is
## no longer supported by Apple or Homebrew. If I can get this working there
## that will be a nice thing for folks who can only afford cheap old Macs
## (i.e., The "real" rest of us, if a Mac is still that computer for the rest
## of us that is)... My first serious home box was a used refurbished
## Mac IIx (that was a long time ago)... It was still considered pretty
## powerful when I got it. (it was my first Digital Audio Workstation (DAW)
## for making music back around 1995) ;-)
##
## 2019-002-14 - Alisha Awen [email protected]
## I have been troubleshooting Zsh problems on Mac OS for a while...
## First environment variables and now Zsh is not loading correctly...
## I believe I have a lame Mac OS solution running now. (with band-aid)
## So far on Mac OS it is working as long as you start Emacs from the shell.
## Qubes (Fedora 29, Debian 9) etc. work nicely now...
##
## 2019-002-08 - Alisha Awen [email protected]
## Reorganized this file to make it multiplatform like its companion .zshrc...
##
## 2019-001-24 - Alisha Awen [email protected]
## Copied most (except one or two) exports from .zshrc to this new file...
## Also copied some things from old legacy .profile into here as well...
## Removed .profile from my Mac OS $HOME. Not needed anymore according to
## BASH official docs... I am still trying to get Emacs environment in sync
## with Zsh, Bash, etc...
#### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export SH_DBG=false
#### ~~~~~~~~~~~~~~~~~~~~
## BEGIN: .zshenv Evaluation - Entering File
# DEBUG Print Statements: (Export SH_DBG in your shell session to enable)
if [ "$SH_DBG" = true ] ; then
echo "ZSH ENV - Entering & Evaluating: \$DOTFILES/.zshenv"
fi
#### ~~~~~~~~~~~~~~~~~~~~
## Set architecture flags to X86 64bit (all platforms):
export ARCHFLAGS="-arch x86_64"
## Define Local Go Language environment: (needs to be before bin PATH definitions)
export GOPATH="$HOME/gopath"
### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## BEGIN: OS Specific Sections
### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if [[ "$OSTYPE" == "linux-gnu" ]]; then
#### ~~~~~~~~~~~~~~~~~~~~
## BEGIN: Linux Specific Configs...
# DEBUG Print Statements: (Export SH_DBG in your shell session to enable)
if [ "$SH_DBG" = true ] ; then
echo "\$DOTFILES/.zshenv - BEGIN: LINUX CASE"
fi
#### ~~~~~~~~~~~~~~~~~~~~
###
# Export Linux specific $PATH:
# NOTE1: Update the single line Path definitions below, from other lines
# that are sometimes programmatically added to the bottom of other
# shell init files after installing things! Don't let them get all
# tangled up in different places! Keep them all here in one place!
#
# NOTE2: Make sure all /bin directory paths under `/user/local` occur BEFORE
# `/usr/bin` directory paths within the export directive below.
#
# NOTE3: You may need to make adjustments to the default path exports below
# depending on your flavor of unix, and whether you have some of the
# packages/plugins/binaries/libraries installed in a different place.
# But for most cases, the exports already defined below are the default
# paths on Linux and Mac OS. The .rbenv paths assume you installed
# .rbenv and used it to install ruby. (change it if you don't want it)
###
## Export Linux executable $PATH:
export PATH="$HOME/.bin:$HOME/.local/bin:$HOME/.rbenv/bin:$HOME/.rbenv/plugins/ruby-build/bin:$GOPATH/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:$PATH"
## Export Linux Manual $PATH:
## TODO: Add this in later...
###
## Top Level Machine Specific Exports:
# Define Main GIT Home directory: (for all or most of your cloned git projects)
export GIT=$HOME/GIT
# Define Main WWW directory: (for all or most of your web site and web app projects)
export WWW=$HOME/WWW
# Qubes Split GPG defs: (you don't need this if you don't use Qubes OS...
export QUBES_GPG_DOMAIN="pgp_vault"
export QUBES_GPG_AUTOACCEPT=86400
#### ~~~~~~~~~~~~~~~~~~~~
## END: Linux Specific Configs...
# DEBUG Print Statements: (Export SH_DBG in your shell session to enable)
if [ "$SH_DBG" = true ] ; then
echo "\$DOTFILES/.zshenv - END: LINUX CASE"
fi
#### ~~~~~~~~~~~~~~~~~~~~
elif [[ "$OSTYPE" == "darwin"* ]]; then
#### ~~~~~~~~~~~~~~~~~~~~
## BEGIN: Mac OS Specific Configs...
# DEBUG Print Statements: (Export SH_DBG in your shell session to enable)
if [ "$SH_DBG" = true ] ; then
echo "\$DOTFILES/.zshenv - BEGIN: MAC-OS CASE"
fi
#### ~~~~~~~~~~~~~~~~~~~~
###
# Export Mac OS specific $PATH:
# NOTE1: Update the single line Path definitions below, from other lines
# that are sometimes programmatically added to the bottom of other
# shell init files after installing things! Don't let them get all
# tangled up in different places! Keep them all here in one place!
#
# NOTE2: Make sure all /bin directory paths under `/user/local` occur BEFORE
# `/usr/bin` directory paths within the export directive below. This
# is mostly for the sake of Homebrew on Mac OS...
#
# NOTE3: You may need to make adjustments to the default path exports below
# depending on your flavor of unix, and whether you have some of the
# packages/plugins/binaries/libraries installed in a different place.
# But for most cases, the exports already defined below are the default
# paths on Linux and Mac OS. The .rbenv paths assume you installed
# .rbenv and used it to install ruby. (change it if you don't want it)
###
## Export Mac OS specific $PATH: (This may be different for older versions of Mac OS)
export PATH="$HOME/.bin:$HOME/.local/bin:$GOPATH/bin:/opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/Library/TeX/texbin:/usr/X11/bin:$PATH"
## Export GNU Info Path: (This may be different for older versions of Mac OS)
export INFOPATH="/usr/share/info:/usr/share/man:$INFOPATH"
## Export Manual Path: (This may be different for older versions of Mac OS)
# export MANPATH="???:$MANPATH"
### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Top Level Machine Specific Exports:
### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Set Default Emacs for programs like cask to use:
export EMACS="/Path/to-your/built-from-source/Emacs-27-Installed.app"
## Define Main GIT Home directory: (for all or most of your cloned git projects)
export GIT=$HOME/Documents/GIT
## Define Main WWW directory: (for all or most of your web site and web app projects)
export WWW=$HOME/Documents/WWW
###
# Ensure 'gpg-agent' (not ssh-agent) is running when a SSH client needs it.
# NOTE: This assumes you are using a PGP "Auth" [A] subkey instead of the
# standard SSH key with ssh-agent as your local cached SSH key when
# connecting to SSH HOSTS. Un comment the next two lines if you
# need them for this...
# Otherwise, if you connect with SSH the standard way
# instead, you may ignore the next two lines...
# gpg-connect-agent /bye
# export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
#### ~~~~~~~~~~~~~~~~~~~~
## END: Mac OS Specific Configs...
# DEBUG Print Statements: (Export SH_DBG in your shell session to enable)
if [ "$SH_DBG" = true ] ; then
echo "\$DOTFILES/.zshenv - END: MAC-OS CASE"
fi
#### ~~~~~~~~~~~~~~~~~~~~
fi
#### ~~~~~~~~~~~~~~~~~~~~~
# END OS Specific Section:
#### ~~~~~~~~~~~~~~~~~~~~~
#### ~~~~~~~~~~~~~~~~~~~~
## BEGIN: Generic Platform Independent Exports (all unix flavors):
# DEBUG Print Statements: (Export SH_DBG in your shell session to enable)
if [ "$SH_DBG" = true ] ; then
echo "\$DOTFILES/.zshenv - BEGIN: Final Generic Section"
fi
#### ~~~~~~~~~~~~~~~~~~~~
## Export your PGP Primary Key Fingerprint for easy input for commands etc.
export SFING="0xFFFFAAAA55550000FFFFAAAA55550000FFFFAAAA"
## Ensure GnuPG gets the output of the 'tty' command.
export GPG_TTY=$(tty)
### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Platform Independent Global Directory Definitions:
# NOTE: These are suggested defaults... Adjust these
# as needed for your own environment setup...
### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Define Global Path to my Development SandBox (DSB)
export DSB=$GIT/dev-sandbox
## Define Global Path to Tools Presets (for tools like .dotfiles) home directory:
export TOOLS=$GIT/tools
## Define Global Path to public .dotfiles (Github:HarmonicAlchemy)
export DF=$TOOLS/dotfiles
## Define Global Path to My-Docs" home Directory:
export MD=$GIT/My-Docs
## Define your www devOps home directory:
export MWMD=$WWW/DevOps
## Define Global Path to your "Personal Templates" home Directory:
export PT=$GIT/Personal-templates
#### ~~~~~~~~~~~~~~~~~~~~
## Load NVM: (Node.js, NPM) etc...
## NOTE: This assumes you cloned or installed 'creationix/nvm' from Github locally
## in your $HOME environment. The next lines set up that environment for you...
## If you are not using NVM than comment out this section!! You will
## eventually need this for some nice web-apps and tools though!
##
## BEGIN: Generic Platform Independent Exports (all unix flavors):
## DEBUG Print Statements: (Export SH_DBG in your shell session to enable)
if [ "$SH_DBG" = true ] ; then
echo "\$DOTFILES/.zshenv - LOAD: NVM Enviornment & Completions"
fi
#### ~~~~~~~~~~~~~~~~~~~~
export NVM_DIR="$HOME/.nvm"
# Load nvm:
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# Load NVM bash_completion:
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
#### ~~~~~~~~~~~~~~~~~~~~
## Load rbenv Ruby Version Management Tool:
## NOTE: Make sure you have cloned rbenv from Github to $HOME/.rbenv!
## If you decide not to use rbenv comment out this section and remove
## the .rbenv paths from above path export line as well...
## DEBUG Print Statements: (Export SH_DBG in your shell session to enable)
if [ "$SH_DBG" = true ] ; then
echo "\$DOTFILES/.zshenv - LOAD: Ruby Version Management Tool"
fi
#### ~~~~~~~~~~~~~~~~~~~~
if which rbenv > /dev/null; then
eval "$(rbenv init -)";
fi
#### ~~~~~~~~~~~~~~~~~~~~
## END: Generic Platform Independent Definitions (all unix flavors):
## END: ~/.zshenv - Leaving File...
## DEBUG Print Statements: (Export SH_DBG in your shell session to enable)
if [ "$SH_DBG" = true ] ; then
echo "\$DOTFILES/.zshenv - END: Final Generic Section - Leaving File"
fi
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~