Neil Macy

Setting Up A New Mac With Dotfiles

I got a new laptop for work recently. I used to enjoy setting up a new computer, but as I get more and more into customising and automating and scripting etc, I find it harder and harder to get the thing back to the way I like it.

A few years ago I half-heartedly made a "dotfiles" repo. So named because it is a repo containing all those config files that start with a ., like .gitconfig, .zshrc etc. I forgot about it until recently, and realised when I rediscovered it that this is exactly what I want.

You can find my dotfiles repo here.

I can store all the config I have tweaked over the years, without having to jump between computers to figure out what's different. I've modernised the dotfiles themselves a lot (e.g. moving from bash to zsh), and updated the install script so that with one command I can install a load of dependencies.

The Brewfile is a particularly cool part of this. You can install Homebrew packages, applications and even Mac App Store apps through this one file.

So now, running a single script installs my settings, and gives me Homebrew, Oh My ZSH, Xcode command line tools, and a load of applications.

This goes along with my recent XcodeTheme repo. I'm always looking for ways to avoid repeating work, even if it's something I only have to do every few years!

There's also a cool dotfiles site on GitHub that I'm going to be using to tweak my scripts even more. I think there's a lot more that I can do to make setting up a new machine a nice one-step process. Feel free to share any ideas you have too!

Published on 7 February 2022