This repository serves as my way to help me setup and maintain my Mac. It takes the effort out of installing everything manually. Everything needed to install my preferred setup of macOS is detailed in this readme. Feel free to explore, learn and copy parts for your own dotfiles.
These instructions are for when you've already set up your dotfiles. If you want to get started on your own dotfiles you can find instructions below.
First, go through the checklist below to make sure you didn't forget anything before you wipe your hard drive.
- Did you commit and push any changes/branches to your git repositories?
- Did you remember to save all important documents from non-iCloud directories?
- Did you save all of your work from apps which aren't synced through iCloud?
- Did you remember to export important data from your local database?
- Did you update mackup to the latest version and ran
mackup backup
?
After going through our checklist above and making sure you backed everything up, we're going to cleanly install macOS with the latest release. Follow this article to cleanly install the latest macOS version.
If you did all of the above you may now follow these install instructions to setup a new Mac.
- Update macOS to the latest version with the App Store
- Install Xcode from the App Store, open it and accept the license agreement
- Install macOS Command Line tools by running
xcode-select --install
- Generate a new public and private SSH key by running:
curl https://raw.githubusercontent.com/rawilk/dotfiles/HEAD/ssh.sh | sh -s "<your-email-address>"
- Clone this repo to
~/.dotfiles
with:
git clone git@github.com:rawilk/dotfiles.git ~/.dotfiles
- Run the installation with:
~/.dotfiles/fresh.sh
- After mackup is synced with your local storage, restore preferences by running
mackup restore
- Restart your computer to finalize the process
đź’ˇ You can use a different location than
~/.dotfiles
if you want. Make sure you also update the reference in the.zshrc
file.
Your Mac is now ready to use!
curl https://raw.githubusercontent.com/rawilk/dotfiles/HEAD/ssh.sh | sh -s "<your-email-address>"
git clone git@github.com:rawilk/dotfiles.git ~/.dotfiles
~/.dotfiles/fresh.sh
~/.dotfiles/macos/set-defaults.sh
It's generally a good idea to sign your git commits with a gpg key. This article explains why you would want to do this in more detail. To do this, you will need to generate a new gpg key and tell GitHub about it.
Your key must use RSA.
gpg --full-generate-key
- At the prompt, specify the kind of key you want - press
Enter
to accept the default - At the prompt, specify the key size you want - press
Enter
to accept the default. Your key must be at least4096
bits. - Enter the length of time the key should be valid. Press
Enter
to specify the default selection, indicating that the key doesn't expire. - Enter your user ID information
- Ensure you are using the verified email address for your GitHub account.
- Type a secure passphrase
gpg --list-secret-keys --keyid-format=long
From the list of GPG keys, copy the long form of the GPG key ID you'd like to use. In this example, the GPG key ID is 3AA5C34371567BD2
:
gpg --list-secret-keys --keyid-format=long
/Users/hubot/.gnupg/secring.gpg
------------------------------------
sec 4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10]
uid Hubot
ssb 4096R/42B317FD4BA89E7A 2016-03-10
Paste the command below, substituting the GPG key ID you'd like to use. In this example, the GPG key ID is 3AA5C34371567BD2
:
gpg --armor --export 3AA5C34371567BD2
# Prints the GPG key ID, in ASCII armor format
Now you can add the key to your GitHub account.
Using the same key ID from the example above, enter the following command:
git config --global user.signingkey 3AA5C34371567BD2
To auto-sign all commits, enter the following command:
git config --global commit.gpgSign true
Please note that the instructions below assume you already have set up Oh My Zsh so make sure to first install Oh My Zsh before you continue.
If you want to install your own dotfiles from this setup, it's pretty easy to do so. First you'll need to fork this repo. After that you can tweak it any way you want.
Go through the .macos
file and adjust the settings to your liking. You can find much more settings at the original script by Mathias Bynens and Kevin Suttle's macOS Defaults project.
Check out the Brewfile
file and adjust the apps you want to install for your machine. Use their search page to check if the app you want to install is available.
Check out the .aliases
file and add your own aliases. If you need to tweak your $PATH
check out the .zshrc
file. More info about how to customize Oh My Zsh can be found here.
Inspiration for these dotfiles taken from: