Whether it’s from regular lifecycling or a hardware issue, it is important to have a way to get yourself back up and running after a machine change. I used to use an Ansible playbook to do this, but I found the solution to be too clunky.
The method I settled on leverages GNU Stow along with a Git repository to hold my dotfiles and other ancillary files.
If I’m setting up a new Mac, I start with scripts/mac.sh; it:
- sets a bunch of preferences via
defaults write - checks for and installs xcode (if it doesn’t exist)
- gets the setup repository (if it doesn’t exist)
- installs Oh My ZSH
- installs or updates Brew
- configures vim to my liking
- brew installs the fonts and software I use
- runs
stow .in the setup directory to symlink some ofsetup’s content - uses
sayto let me know the setup is done
Since I don’t want all of the content in setup/ to be symlinked, I use .stow-local-ignore to tell Stow what to skip when symlinking.