Past-Me has been a jerk many times. Past-Tim doesn’t think about Future-Tim, saving him time, money, and sometimes even heartache. Setting up a new Mac can be a huge pain, and thankfully Past-Me finally did something nice for Future-Me.
I left great documentation and resources that helped me get this new machine setup in about thirty minutes. That’s unheard of. But as with everything, there are still some holes that need patching, so I thought I’d write something up, to document the process even better for next time. After all, Past-Tim is now me.
Important Caveat: I don’t setup new Macs from a backup; I like to start fresh. If you like starting your new Mac from a Time Machine backup, you don’t need most—if not all—of this.
Step One: Clone dotfiles Repo
# First we clone the repo $ git clone email@example.com:smithtimmytim/dotfiles.git ~/.dotfiles # Then we run the install script $ cd .dotfiles $ script/bootstrap
dotfiles version controlled is awesome, and this is the first machine I setup with them. The repo comes with a list of packages and apps to be installed. When I run the install script that comes with
dotfiles, it installs Homebrew, sets up sensible macOS defaults, and much more. My vital apps like 1Password, Dropbox, Alfred, etc, are all installed. Also, because I use mas—which you can install via Homebrew—all of my favorite Mac App Store apps are installed too.
You may be asking yourself, how is this possible? In part to
dotfiles, but the
Brewfile is where the magic happens. If you’re familiar with a
Brewfile is that, but for Homebrew. It contains a list of the packages and apps I want installed. You can look at my
Brewfile here, and you can read more about the whole concept on GitHub.
Also, once you clone
dotfiles you might notice that you can’t see it. That’s because files that begin with a period are hidden by default. Make those files visible by entering the following command into the terminal:
$ defaults write com.apple.finder AppleShowAllFiles YES
Let’s also make zsh our default shell, because Bash is ugly.
chsh -s $(which zsh)
Step Two: Install Ruby Versions and Gems
$ rbenv install 2.5.0
Now, let’s install the gems I need in each Ruby version:
$ gem install bundler jekyll
Step Three: Install Settings Sync in Visual Studio Code
In years past, I’d used Atom, but since have switched to Visual Studio Code. I use a package called Settings Sync to keep track of all of my settings, keymaps, preferences, etc. Once the package is installed, download the settings, and connect it all to the existing Gist that has everything. Voilà!
Step Four: Create new SSH and GPG Keys
You’ll need an SSH and GPG key for lots of things, but I primarily use mine for GitHub. Creating a new SSH key is pretty easy. Here’s some documentation on how to do that.
Now, for the GPG key. This isn’t as simple, and honestly I don’t know how this works. I did some research on whether you’re supposed to create a new GPG key when you move machines or whether you’re supposed to migrate them, and was still confused. If you know more information about this, I’d love to hear from you on Twitter.
Anyway, first you need to download the GPG command line tools to create new keys. I download GnuPG for OS X. Once you’ve done that, you can follow the steps from the GitHub documentation to create your new key and add it to GitHub.
You might be wondering, what the hell is GPG? Well, that’s quite the hefty answer. I found this page to be very informative.
Step Five: Login to 1Password App
I’m shocked at how amazing the setup for this has become. Kelly and I are using 1Password Families, so setting up the app on a new machine is now as easy as scanning a QR code, inputting my master password, and… that’s it. I’m still baffled at how easy it was.
At this point, 1Password is the gate to everything else. Once I have 1Password installed and setup, I now have access to all of my software license codes, website logins, and a whole lot more.
Step Six: Login to Dropbox App
I run most of my system through Dropbox. I pay for the Pro plan which get’s me a terabyte of space. I think the only things I don’t have on Dropbox are the sites and projects I work on, because all of that is on GitHub. Doing things this way is pretty convenient, and helps me take all my important files to the new computer.
However, the initial setup of this is not fun. Because Dropbox on the Mac currently downloads all of your files locally, when you first do this, it can take days to sync. This isn’t ideal because some files are more important than others at the beginning. I want to have my Alfred preferences, or my Keyboard Maestro macros first. But to do that, I have to go through the nightmare of setting up selective sync and then redoing it once the right files have downloaded. Eventually—who the hell knows when—Dropbox will launch Project Infinite for everyone. That’ll solve this problem and more.
All this being said, it doesn’t mean you shouldn’t have a backup! I use Time Machine to keep backups just in case things get wonky. Dropbox has lost files of mine before, so I like to have a plan b. The Sweet Setup’s advice on this topic is wise.
In summary, this setup process is pretty awesome. Automating things like this saves so much time, and gets me coding quicker. I’m loving my new Mac, and a large part of it, is that setting it up was headache free. If you decide to use this, I’d love to hear about it! If you need help, don’t hesitate to get in touch.
Enjoy your new Mac!
Update on 11/06/2018 at 9:12pm CST - Adding some updated info since small things have changed. For example, I no longer use Atom.
rbenv? Ruby is a regularly updated language with new features and security patches. Different projects will run different Ruby versions based on the dependencies of the project. Being able to use multiple Ruby versions is important if you work with Ruby. The
READMEis a great resource too. ↩