Skip to content

πŸ‘¨β€πŸ’» My settings and configuration files

Notifications You must be signed in to change notification settings

andrewwestling/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

dotfiles

These are my configuration files and notes for setting up a new Mac.

Do the following, in this order:

  1. Clone this repo
  2. Install oh-my-zsh
  3. Install Rosetta 2 (for Apple Silicon Macs)
  4. Install Homebrew and packages
  5. Set computer name
  6. Set up 1Password
  7. Sign into iCloud
  8. Sign into Fastmail
  9. Install Mac App Store apps
  10. Set up SSH
  11. Set up Node

Clone this repo

Run git once so macOS will try to install command line tools:

git

Make directory and clone

mkdir ~/Code && git clone https://github.com/expandrew/dotfiles ~/Code/dotfiles

Copy git configuration

cp ~/Code/dotfiles/.gitconfig ~/.gitconfig
cp ~/Code/dotfiles/.gitignore_global ~/.gitignore_global

(There's a VS Code task to do this in tasks.json: πŸ’» Update Mac: git)

oh-my-zsh

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Copy zsh configuration

cp ~/Code/dotfiles/.zshrc ~/.zshrc

(There's a VS Code task to do this in tasks.json: πŸ’» Update Mac: zshrc)

Rosetta 2

sudo softwareupdate --install-rosetta

Homebrew

Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Get brew in the PATH for now:

eval "$(/opt/homebrew/bin/brew shellenv)"

Install everything from Brewfile, except Mac App Store apps - mas won't work yet, because I haven't signed into iCloud at this point - this has a dependency on 1Password step to get the password, so we'll re-run brew bundle again below after 1Password and iCloud are set up.

cd ~/code/dotfiles && brew bundle

Multi-user setup

Details for using Homebrew with multiple accounts

If there are multiple user accounts on the same Mac, I need to follow a few extra steps:

  1. Open System Preferences > Users & Groups
  2. Create a new group called brew; add all the users to it
  3. Run these steps:
% sudo chgrp -R brew $(brew --prefix) # Change group to brew for Homebrew
% sudo chmod -R g+w $(brew --prefix) # Allow group members to write inside this directory
% brew doctor # Make sure everything is good

Even with this "shared group" setup, I still run into permissions issues sometimes when running brew bundle.

Usually I can resolve it by changing ownership to the current user for the Homebrew folder:

% sudo chown -R $USER $(brew --prefix)
% brew bundle # Try installing again

Brewfile

Details for updating Brewfile

This is how I update the Brewfile when I install/uninstall something:

% cd ~/code/dotfiles && brew bundle dump -f
# Then commit the changes to this repo, etc.

I just do this periodically and commit it, it's not automated but the command handles the file for me so I don't have to handwrite it

(There's a VS Code task to do this in tasks.json: πŸ“ Update Brewfile)

Computer Name

Set the computer name from System Preferences > Sharing.

1Password

Set up using the camera/phone thing via mobile app. Use Yubikey for MFA.

iCloud

Sign into iCloud now that 1Password is set up. Use discretion for which "Apps using iCloud" to enable, but ensure the following are enabled:

  • Photos
  • iCloud Drive
  • iCloud Mail
  • Passwords & Keychain
  • Messages in iCloud
  • Find My Mac
  • Reminders
  • Safari
  • Phone & FaceTime
  • Raycast

Set up a symlink for iCloud Drive at ~/iCloud:

ln -s ~/Library/Mobile\ Documents/com\~apple\~CloudDocs ~/iCloud

Fastmail

Create a new App Password for Fastmail at Settings > Password & Security > Third Party Apps > App Passwords > New App Password.

Once it's created, download the profile with the link it provides, and open System Preferences > Profile and install it.

Mac App Store

After setting up 1Password and iCloud above, run the Homebrew install step again to install Mac App Store apps.

cd ~/code/dotfiles && brew bundle # The `mas` steps should complete now that we're signed into iCloud

SSH

Enable the 1Password SSH Agent:

  • Open the 1Password app and choose 1Password > Settings from the menu bar, then select Developer.
  • Select Set Up SSH Agent

Node

Install nvm:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

Close and reopen the terminal, then install the lastest available version of Node:

nvm install node

About

πŸ‘¨β€πŸ’» My settings and configuration files

Resources

Stars

Watchers

Forks