by bloopernova · 4y ago · 0 comments
Couple of bits from a guide I wrote recently: https://gist.github.com/aclarknexient/0ffcb98aa262c585c49d4b...
# store stuff here that you don't want in github
[[ -f $HOME/.zshenv-local ]] && source $HOME/.zshenv-local
# depends on 'brew install grep'
[[ $OSTYPE =~ ^darwin.* ]] && alias grep='ggrep --colour=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}'
That OSTYPE is great for all those little bits that are unique to each operating system. The zshenv-local is in .gitignore, so you can keep tokens, api keys, etc etc in there. OSTYPE could even be used to import specific files like .zshenv-darwin or .zshenv-linux-gnuIf you're ssh'ing between your hosts, you can use something like this:
if [[ -n $SSH_CONNECTION ]]; then
ZSH_THEME="afowler"
else
ZSH_THEME="powerlevel10k/powerlevel10k"
fi
It's not fancy and doesn't use cool tools, but my setup works for me just fine.I'm gonna go though your guide later though-- I like quite a bit of what I've skimmed so far. Thanks for posting that.
EDIT: and that "*" for gitignore is intriguing, I'll have to take a better look at that whitelist vs blacklist setup, thank you!
git clone <repo> .dotfiles && cd .dotfiles
stow --target=$HOME --dir=packages shell-config
stow --target=$HOME --dir=packages work-stuff
I've found this to be much more manageable than tools like yadm since I can pick-and-choose sets of configs/scripts based on the machine I'm using them on.