Skip to content

katelovescode/dotfiles

Repository files navigation

KateLovesCode's Dotfiles

A Fresh macOS Setup

Requirements

  • Homebrew
  • 1Password (if you want to use the same templates and authorization tools I have configured)

Before you re-install

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?

Installing macOS cleanly

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.

Setting up your Mac

  1. Update macOS to the latest version with the App Store

  2. 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

  3. 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
  4. Install Homebrew

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  5. Install 1Password for Mac (Desktop)

  6. Install the 1Password CLI using their official instructions (there's a homebrew option as well)

  7. Sign into your 1Password CLI in the terminal

  8. Fork this repo into your own account

  9. Install Chezmoi w/ Homebrew

    brew install chezmoi
  10. Initialize chezmoi with your repository

    chezmoi init --ssh git@github.com:[username]/dotfiles.git
  11. Edit the 1Password tmpl files using the following instructions:

    1. ➜ 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]
      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 0 is the index of the field (notesPlain) that holds my token in the field array.
      {{ (index (onepassword "My Item Name").fields 0).value }}
    2. 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
    3. 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
  12. Edit the ~/.config/chezmoi/chezmoi.toml file [data] section to reflect the email on the git account you use for your current computer

  13. 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.

  14. 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.

  15. 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
  16. Apply your dotfiles; a post-install script will also run, applying your preferences and installing the taps you specified in the Brewfile

    chezmoi apply
  17. Install Postgres.app - so far no easy way to do this automatically

Your Mac is now ready to use!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published