Introduce zshenv to the mix as well
This commit is contained in:
parent
bb3a2cf672
commit
40787150bd
14
setup.sh
14
setup.sh
@ -9,17 +9,15 @@ if [[ ! -d $XDG_CONFIG_HOME ]]; then
|
|||||||
mkdir -p "$XDG_CONFIG_HOME"
|
mkdir -p "$XDG_CONFIG_HOME"
|
||||||
fi
|
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.
|
# Symlink directories to $XDG_CONFIG_HOME.
|
||||||
directories=("gem" "ghostty" "git" "gnupg" "k9s" "lazygit" "neovide" "nvim" "starship" "tmux" "zed")
|
directories=("gem" "ghostty" "git" "gnupg" "k9s" "lazygit" "neovide" "nvim" "starship" "tmux" "zed")
|
||||||
for directory in "${directories[@]}"; do
|
for directory in "${directories[@]}"; do
|
||||||
if [[ -d "$XDG_CONFIG_HOME/$directory" ]]; then continue; fi
|
if [[ -d "$XDG_CONFIG_HOME/$directory" ]]; then continue; fi
|
||||||
ln -sfv "$SCRIPTPATH/$directory" "$XDG_CONFIG_HOME/$directory"
|
ln -sfv "$SCRIPTPATH/$directory" "$XDG_CONFIG_HOME/$directory"
|
||||||
done
|
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
|
||||||
|
|||||||
@ -1,4 +0,0 @@
|
|||||||
export GPG_TTY="$(tty)"
|
|
||||||
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
|
||||||
gpgconf --launch gpg-agent
|
|
||||||
|
|
||||||
@ -5,3 +5,6 @@ alias rsyncdir="rsync -az --progress"
|
|||||||
CERT_PATH=$(python -m certifi)
|
CERT_PATH=$(python -m certifi)
|
||||||
export SSL_CERT_FILE=${CERT_PATH}
|
export SSL_CERT_FILE=${CERT_PATH}
|
||||||
export REQUESTS_CA_BUNDLE=${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
|
||||||
|
|||||||
58
zsh/zprofile
58
zsh/zprofile
@ -1,70 +1,20 @@
|
|||||||
# vim: filetype=zsh
|
# vim: filetype=zsh
|
||||||
|
|
||||||
SCRIPTPATH=$HOME/.config/dotfiles/zsh
|
SCRIPTPATH=$HOME/.config/dotfiles/zsh
|
||||||
|
ZSH_CACHE_DIR="$HOME/.cache/zsh"
|
||||||
|
|
||||||
# google cloud sdk
|
# google cloud sdk
|
||||||
if [[ -a "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc" ]]; then
|
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"
|
source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc"
|
||||||
fi
|
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
|
# homebrew
|
||||||
if [[ -a "/opt/homebrew/bin/brew" ]]; then
|
if [[ -a "/opt/homebrew/bin/brew" ]]; then
|
||||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# asdf
|
# plugins
|
||||||
if [[ -d "$HOME/.asdf/shims" ]]; then
|
mkdir -p "$ZSH_CACHE_DIR"
|
||||||
export PATH="$HOME/.asdf/shims:$PATH"
|
source "$SCRIPTPATH/dotenv.zsh"
|
||||||
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
|
|
||||||
|
|
||||||
# other files
|
# other files
|
||||||
source "$SCRIPTPATH/functions.zsh"
|
source "$SCRIPTPATH/functions.zsh"
|
||||||
|
|||||||
54
zsh/zshenv
Normal file
54
zsh/zshenv
Normal 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
|
||||||
12
zsh/zshrc
12
zsh/zshrc
@ -5,7 +5,6 @@ colors
|
|||||||
|
|
||||||
# Make sure moving by whole word can stop at directories
|
# Make sure moving by whole word can stop at directories
|
||||||
WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
|
WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
|
||||||
ZSH_CACHE_DIR="$HOME/.cache/zsh"
|
|
||||||
|
|
||||||
# history support, time reporting, auto-cd
|
# history support, time reporting, auto-cd
|
||||||
HISTFILE=~/.zhistory
|
HISTFILE=~/.zhistory
|
||||||
@ -47,14 +46,3 @@ fi
|
|||||||
if [[ -d "$HOME/.asdf/completions" ]]; then
|
if [[ -d "$HOME/.asdf/completions" ]]; then
|
||||||
fpath=($HOME/.asdf/completions $fpath)
|
fpath=($HOME/.asdf/completions $fpath)
|
||||||
fi
|
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
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user