- Homebrew
- 1Password (if you want to use the same templates and authorization tools I have configured)
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 all changes/branches to your git repositories?
- move all documents from non-cloud directories to a cloud storage service?
- save all work from non-cloud apps to a cloud storage service?
- export all important data from your local db?
- remove all your ssh keys from your services?
- add all your important config files to this repository using the chezmoi templates to handle any secrets?
After going through the 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.
-
Update macOS to the latest version with the App Store
-
Set up a new SSH key and add it to github:
ssh-keygen -t rsa -C "your_email@example.com" pbcopy < ~/.ssh/id_rsa.pub ##### copies public key to your clipboard
Paste this key from your clipboard into Github's SSH key settings
-
Add the key to your keychain so you aren't prompted for your passphrase every time you interact with github (optional)
ssh-add --apple-use-keychain ~/.ssh/id_rsa
-
Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Install 1Password for Mac (Desktop)
-
Install the 1Password CLI using their official instructions (there's a homebrew option as well)
-
Fork this repo into your own account
-
Install Chezmoi w/ Homebrew
brew install chezmoi
-
Initialize chezmoi with your repository
chezmoi init --ssh git@github.com:[username]/dotfiles.git
-
Edit the 1Password tmpl files using the following instructions:
-
This should show you the field array, and the integer in the template is the index of the item you want in that array. In the example above, "My Item Name" is my entry title, and
➜ op item get "My Item Name" ID: [Item ID] Title: My Item Name Vault: [Vault Name] ([Vault ID]) Created: [Date] Updated: [Date] by [User] Favorite: [false/true] Tags: [Tag Names] Version: 1 Category: SECURE_NOTE Fields: notesPlain: [token_saved_here]
0
is the index of the field (notesPlain) that holds my token in the field array.{{ (index (onepassword "My Item Name").fields 0).value }}
- Change the templates in the following files to your 1Password entry name and field index for your Github token
~/.local/share/chezmoi/private_dot_zshrc.tmpl
~/.local/share/chezmoi/dot_config/private_hub.tml
- Change the template in the following file to your 1Password entry name and field index for your NGrok token
~/.local/share/chezmoi/private_dot_ngrok2/private_ngrok.yml.tmpl
-
-
Edit the ~/.config/chezmoi/chezmoi.toml file
[data]
section to reflect the email on the git account you use for your current computer -
Go through the
.macos
file and adjust the settings to your liking. You can find 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. -
Commit your changes and push up to your remote.
chezmoi cd git add . git commit -m "Personal changes for my dotfiles config" git push -u origin main
-
Apply your dotfiles; a post-install script will also run, applying your preferences and installing the taps you specified in the Brewfile
chezmoi apply
-
Install Postgres.app - so far no easy way to do this automatically
Your Mac is now ready to use!