1
0
mirror of https://github.com/kremalicious/dotfiles.git synced 2024-11-21 17:27:13 +01:00

adopt for homebrew path

This commit is contained in:
Matthias Kretschmann 2023-01-23 18:05:14 +00:00
parent ff400f72ec
commit 9b24b09040
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 50 additions and 28 deletions

View File

@ -54,9 +54,9 @@ echo " ✓ done$(tput sgr0)"
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Switch to using brew-installed zsh as default shell # Switch to using brew-installed zsh as default shell
if ! grep -F -q '/usr/local/bin/zsh' /etc/shells; then if ! grep -F -q '/opt/homebrew/bin/zsh' /etc/shells; then
echo '/usr/local/bin/zsh' | sudo tee -a /etc/shells; echo '/opt/homebrew/bin/zsh' | sudo tee -a /etc/shells;
chsh -s /usr/local/bin/zsh; chsh -s /opt/homebrew/bin/zsh;
fi; fi;
echo "$(tput setaf 64)=============================================" echo "$(tput setaf 64)============================================="

45
exports
View File

@ -8,35 +8,50 @@ export LANG="en_US"
# PATH # PATH
# --------------------------------------------------- # ---------------------------------------------------
PATH_OPENSSL=/usr/local/opt/openssl/bin # Homebrew path differs between Intel/Apple Silicon
# See https://apple.stackexchange.com/questions/437618/why-is-homebrew-installed-in-opt-homebrew-on-apple-silicon-macs
# Hardcoded paths because `brew --prefix ...` is slow
if [[ $(uname -m) == 'arm64' ]]; then
PATH_HOMEBREW=/opt/homebrew
else
PATH_HOMEBREW=/usr/local
fi
PATH_OPENSSL=$PATH_HOMEBREW/opt/openssl/bin
# PATH_RUBY=$(brew --prefix ruby)/bin # PATH_RUBY=$(brew --prefix ruby)/bin
# PATH_GEMS=/usr/local/lib/ruby/gems/2.6.0/bin # PATH_GEMS=$PATH_HOMEBREW/lib/ruby/gems/2.6.0/bin
PATH_PYTHON=/usr/local/opt/python/libexec/bin PATH_PYTHON=$PATH_HOMEBREW/opt/python/libexec/bin
PATH_GO=/usr/local/opt/go/libexec/bin PATH_GO=$PATH_HOMEBREW/opt/go/libexec/bin
#PATH_RUST=$HOME/.cargo/bin #PATH_RUST=$HOME/.cargo/bin
export GOPATH=$HOME/.go/ export GOPATH=$HOME/.go/
export PATH=$HOME/.bin:/usr/local/bin:$PATH_OPENSSL:$PATH_PYTHON:$GOPATH/bin:$PATH_GO:$PATH export PATH=$HOME/.bin:/$PATH_HOMEBREW/bin:$PATH_OPENSSL:$PATH_PYTHON:$GOPATH/bin:$PATH_GO:$PATH
# define CDPATHs which are autocompleted from when doing cd # define CDPATHs which are autocompleted from when doing cd
export CDPATH=$CDPATH:~/Code export CDPATH=$CDPATH:~/Code
# nvm # nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# defer loading until needed for faster shell startup # defer loading until needed for faster shell startup
declare -a NODE_GLOBALS=(`find ~/.nvm/versions/node -maxdepth 3 -type l -wholename '*/bin/*' | xargs -n1 basename | sort | uniq`) #declare -a NODE_GLOBALS=(`find ~/.nvm/versions/node -maxdepth 3 -type l -wholename '*/bin/*' | xargs -n1 basename | sort | uniq`)
NODE_GLOBALS+=("node") #NODE_GLOBALS+=("node")
NODE_GLOBALS+=("nvm") #NODE_GLOBALS+=("nvm")
load_nvm () { #load_nvm () {
export NVM_DIR="$HOME/.nvm" # export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
} #}
for cmd in "${NODE_GLOBALS[@]}"; do #for cmd in "${NODE_GLOBALS[@]}"; do
eval "${cmd}(){ unset -f ${NODE_GLOBALS}; load_nvm; ${cmd} \$@ }" # eval "${cmd}(){ unset -f ${NODE_GLOBALS}; load_nvm; ${cmd} \$@ }"
done #done
# pip should only run if there is a virtualenv currently activated # pip should only run if there is a virtualenv currently activated
export PIP_REQUIRE_VIRTUALENV=true export PIP_REQUIRE_VIRTUALENV=true
# cache pip-installed packages to avoid re-downloading # cache pip-installed packages to avoid re-downloading
export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache
export GPG_TTY=$(tty)

View File

@ -10,7 +10,7 @@
[user] [user]
name = Matthias Kretschmann name = Matthias Kretschmann
email = m@kretschmann.io email = m@kretschmann.io
signingKey = DD7831FC signingKey = BD3C1F3EDD7831FC
[commit] [commit]
gpgSign = true gpgSign = true
@ -60,6 +60,12 @@
[fetch] [fetch]
prune = true prune = true
[pull]
rebase = false
[init]
defaultBranch = main
[status] [status]
showUntrackedFiles = all showUntrackedFiles = all
@ -89,9 +95,4 @@
clean = git-lfs clean -- %f clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f smudge = git-lfs smudge -- %f
process = git-lfs filter-process process = git-lfs filter-process
[pull]
rebase = false
[gpg]
program = /usr/local/bin/gpg
[init]
defaultBranch = main

10
zshrc
View File

@ -80,8 +80,14 @@ if [[ $#h -gt 0 ]]; then
zstyle ':completion:*:(ssh|scp|rsync|slogin):*' hosts $h zstyle ':completion:*:(ssh|scp|rsync|slogin):*' hosts $h
fi fi
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh if [[ $(uname -m) == 'arm64' ]]; then
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh PATH_HOMEBREW=/opt/homebrew
else
PATH_HOMEBREW=/usr/local
fi
source $PATH_HOMEBREW/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $PATH_HOMEBREW/share/zsh-autosuggestions/zsh-autosuggestions.zsh
# source <(kubectl completion zsh) # source <(kubectl completion zsh)
# #