Introduce zshenv to the mix as well

This commit is contained in:
Ben Kreeger 2025-07-08 14:05:48 -05:00
parent bb3a2cf672
commit 40787150bd
Signed by: kreeger
GPG Key ID: D5CF8683D4BE4B50
6 changed files with 67 additions and 78 deletions

View File

@ -9,17 +9,15 @@ if [[ ! -d $XDG_CONFIG_HOME ]]; then
mkdir -p "$XDG_CONFIG_HOME"
fi
if [[ ! -a "$HOME/.zshrc" ]]; then
ln -sfv "$SCRIPTPATH/zsh/zshrc" "$HOME"/.zshrc
fi
if [[ ! -a "$HOME/.zprofile" ]]; then
ln -sfv "$SCRIPTPATH/zsh/zprofile" "$HOME"/.zprofile
fi
# Symlink directories to $XDG_CONFIG_HOME.
directories=("gem" "ghostty" "git" "gnupg" "k9s" "lazygit" "neovide" "nvim" "starship" "tmux" "zed")
for directory in "${directories[@]}"; do
if [[ -d "$XDG_CONFIG_HOME/$directory" ]]; then continue; fi
ln -sfv "$SCRIPTPATH/$directory" "$XDG_CONFIG_HOME/$directory"
done
zshfiles=("zshenv" "zprofile" "zshrc")
for file in "${zshfiles[@]}"; do
if [[ -a "$HOME/.$file" ]]; then continue; fi
ln -sfv "$SCRIPTPATH/zsh/$file" "$HOME/.$file"
done

View File

@ -1,4 +0,0 @@
export GPG_TTY="$(tty)"
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent

View File

@ -5,3 +5,6 @@ alias rsyncdir="rsync -az --progress"
CERT_PATH=$(python -m certifi)
export SSL_CERT_FILE=${CERT_PATH}
export REQUESTS_CA_BUNDLE=${CERT_PATH}
export GPG_TTY="$(tty)"
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent

View File

@ -1,70 +1,20 @@
# vim: filetype=zsh
SCRIPTPATH=$HOME/.config/dotfiles/zsh
ZSH_CACHE_DIR="$HOME/.cache/zsh"
# google cloud sdk
if [[ -a "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc" ]]; then
source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc"
fi
# rust additions
if [[ -a "$HOME/.cargo/bin" ]]; then
export PATH="$HOME/.cargo/bin:$PATH"
fi
# krew additions
if [[ -a "$HOME/.krew" ]]; then
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
fi
# pythonpath additions
if [[ -a "$HOME/src/oreilly/tools/chassis" ]]; then
export PYTHONPATH="${PYTHONPATH}:$HOME/src/oreilly/tools/chassis"
fi
# Android SDK additions
if [[ -a "$HOME/Library/Android/sdk/platform-tools" ]]; then
export PATH="$HOME/Library/Android/sdk/platform-tools:$PATH"
fi
if [[ -a "$HOME/Library/Android/sdk/emulator" ]]; then
export PATH="$HOME/Library/Android/sdk/emulator:$PATH"
fi
# Local bin additions
if [[ -d "$HOME/bin" ]]; then
export PATH="$HOME/bin:$PATH"
fi
# homebrew
if [[ -a "/opt/homebrew/bin/brew" ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# asdf
if [[ -d "$HOME/.asdf/shims" ]]; then
export PATH="$HOME/.asdf/shims:$PATH"
fi
# env
export EDITOR=nvim
export GOPATH=~/src/golang
export GOBIN=$GOPATH/bin
export PATH=~/bin:$GOBIN:$PATH
export XDG_CONFIG_HOME=$HOME/.config
export TALOSCONFIG=$XDG_CONFIG_HOME/talos/config.yaml
export GNUPGHOME=$XDG_CONFIG_HOME/gnupg
kubeconfig=(
$XDG_CONFIG_HOME/kube/k8s-dev.yaml
$XDG_CONFIG_HOME/kube/k8s.yaml
$XDG_CONFIG_HOME/kube/k8s-old.yaml
$XDG_CONFIG_HOME/kube/gke.yaml
)
export KUBECONFIG=${(j.:.)kubeconfig}
if [[ -d "/opt/homebrew/share/google-cloud-sdk/bin" ]]; then
export PATH=/opt/homebrew/share/google-cloud-sdk/bin:$PATH
fi
# plugins
mkdir -p "$ZSH_CACHE_DIR"
source "$SCRIPTPATH/dotenv.zsh"
# other files
source "$SCRIPTPATH/functions.zsh"

54
zsh/zshenv Normal file
View File

@ -0,0 +1,54 @@
# vim: filetype=zsh
# env
export EDITOR=nvim
export GOPATH=~/src/golang
export GOBIN=$GOPATH/bin
export PATH=~/bin:$GOBIN:$PATH
export XDG_CONFIG_HOME=$HOME/.config
export TALOSCONFIG=$XDG_CONFIG_HOME/talos/config.yaml
export GNUPGHOME=$XDG_CONFIG_HOME/gnupg
kubeconfig=(
$XDG_CONFIG_HOME/kube/k8s-dev.yaml
$XDG_CONFIG_HOME/kube/k8s.yaml
$XDG_CONFIG_HOME/kube/k8s-old.yaml
$XDG_CONFIG_HOME/kube/gke.yaml
)
export KUBECONFIG=${(j.:.)kubeconfig}
# rust additions
if [[ -a "$HOME/.cargo/bin" ]]; then
export PATH="$HOME/.cargo/bin:$PATH"
fi
# krew additions
if [[ -a "$HOME/.krew" ]]; then
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
fi
# pythonpath additions
if [[ -a "$HOME/src/oreilly/tools/chassis" ]]; then
export PYTHONPATH="${PYTHONPATH}:$HOME/src/oreilly/tools/chassis"
fi
# Android SDK additions
if [[ -a "$HOME/Library/Android/sdk/platform-tools" ]]; then
export PATH="$HOME/Library/Android/sdk/platform-tools:$PATH"
fi
if [[ -a "$HOME/Library/Android/sdk/emulator" ]]; then
export PATH="$HOME/Library/Android/sdk/emulator:$PATH"
fi
# Local bin additions
if [[ -d "$HOME/bin" ]]; then
export PATH="$HOME/bin:$PATH"
fi
# asdf
if [[ -d "$HOME/.asdf/shims" ]]; then
export PATH="$HOME/.asdf/shims:$PATH"
fi
if [[ -d "/opt/homebrew/share/google-cloud-sdk/bin" ]]; then
export PATH=/opt/homebrew/share/google-cloud-sdk/bin:$PATH
fi

View File

@ -5,7 +5,6 @@ colors
# Make sure moving by whole word can stop at directories
WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
ZSH_CACHE_DIR="$HOME/.cache/zsh"
# history support, time reporting, auto-cd
HISTFILE=~/.zhistory
@ -47,14 +46,3 @@ fi
if [[ -d "$HOME/.asdf/completions" ]]; then
fpath=($HOME/.asdf/completions $fpath)
fi
# plugins
mkdir -p "$ZSH_CACHE_DIR"
source "$SCRIPTPATH/dotenv.zsh"
# What OS are we running?
if [[ $(uname) == "Darwin" ]]; then
source $SCRIPTPATH/mac-tty.zsh
fi
# See zprofile for all other exports and path configuration