Skip to content

Instantly share code, notes, and snippets.

@suzannealdrich
Last active June 5, 2024 21:05
Show Gist options
  • Save suzannealdrich/2ffd5850bf61128ed036747910d08bea to your computer and use it in GitHub Desktop.
Save suzannealdrich/2ffd5850bf61128ed036747910d08bea to your computer and use it in GitHub Desktop.
macOS 12 Monterey Mostly-Automated Setup

macOS 12 Monterey Setup

An easy to refer to document for setting up macOS 12 Monterey.

Previous Setup Gists

My previous macOS / OSX setup gists:

Install Software

The software selected is software that is "tried and true" --- software I need after any fresh install. I often install other software not listed here, but is handled in a case-by-case basis.

Prerequisites

System Config Files

Files from my personal system-config repository on GitHub. There are some useful scripts and configs that make this process quick. This contains a Brewfile, for example.

git clone https://github.com/suzannealdrich/system-config ~/.system-config

Homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Xcode Command Line Tools

During install of Homebrew, the script will kindly detect that you have not yet installed Xcode Command Line Tools, and pop up a dialog asking if you want to install it. Yes, you do. I defer to install the full Xcode until later since the download takes longer and I want to keep moving forward. For now, just the Xcode Command Line Tools.

Mac App Store Command Line Tools

The mas command by argon is a handy tool to interact with the App Store without needing to point and click, search, and otherwise need manual intervention. This lets us install the next batch of software very quickly using Terminal.

Now that Homebrew is installed, it's easy to get mas:

brew install mas

Install binaries from a Brewfile (apps from App Store using mas, apps from Cask)

Edit Brewfile for last minute changes

You may wish to add or remove a few App Store or Cask items before initiating Homebrew to install all of the applications. If you wish to review these now you may fork the system-config repo and edit the Brewfile (~/.system-config/Brewfile) now.

Install apps

brew bundle --file=~/.system-config/Brewfile

This will take some time, especially if you have a slow internet connection and because Xcode is huge. But it's faster than you having to search the App Store app and click to install for each of these!

Post-Installation

tap "aws/tap"
tap "cloudflare/cloudflare"
tap "homebrew/bundle"
tap "homebrew/cask-fonts"
tap "homebrew/cask-versions"
tap "pantheon-systems/external"
brew "awscli"
brew "cask"
brew "chezmoi"
brew "cloudflared"
brew "curl"
brew "tidy-html5"
brew "php"
brew "composer"
brew "gcc"
brew "gh"
brew "git"
brew "git-flow"
brew "gnupg"
brew "go"
brew "hugo"
brew "jq"
brew "mas"
brew "node"
brew "povray"
brew "roswell"
brew "starship"
brew "terraform"
brew "tree"
brew "wget"
brew "yarn"
brew "aws/tap/copilot-cli"
brew "cloudflare/cloudflare/cf-terraforming"
brew "pantheon-systems/external/terminus"
cask "1password"
cask "1password-cli"
cask "arc"
cask "cloudflare-warp"
cask "discord"
cask "docker"
cask "firefox"
cask "font-hack-nerd-font"
cask "google-chrome"
cask "google-cloud-sdk"
cask "gpg-suite"
cask "iterm2"
cask "keybase"
cask "keymapp"
cask "kindle"
cask "malwarebytes"
cask "minecraft"
cask "notion"
cask "obsidian"
cask "rectangle"
cask "signal"
cask "slack"
cask "spotify"
cask "visual-studio-code"
cask "whatsapp"
cask "zoom"
mas "1Password for Safari", id: 1569813296
mas "Keynote", id: 409183694
mas "Kindle", id: 405399194
mas "Numbers", id: 409203825
mas "Pages", id: 409201541
mas "TestFlight", id: 899247664
mas "Xcode", id: 497799835
mas "Copilot", id: 1447330651
mas "iMovie", id: 408981434
mas "Paprika Recipe Manager 3", id: 1303222628
mas "Home Assistant", id: 1099568401
mas "Ivory", id: 6444602274
mas "Night Sky", id: 475772902
#!/usr/bin/sh
## macOS Preferences
# Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 1
# Set a shorter Delay until key repeat
defaults write NSGlobalDomain InitialKeyRepeat -int 10
# Add a context menu item for showing the Web Inspector in web views
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
# Show the ~/Library folder
chflags nohidden ~/Library
# Store screenshots in subfolder on desktop
# mkdir ~/Desktop/Screenshots
# defaults write com.apple.screencapture location ~/Desktop/Screenshots
## Github
ssh-keygen -t rsa -C "suzannealdrich@`hostname -s`"
# Copy public key to Github.com
# cat ~/.ssh/id_rsa.pub
# Test connection
# ssh -T git@github.com
# Configure SSH for 1Password Agent
# mkdir ~/.ssh/
# touch ~/.ssh/config
# echo -e "Host * \n\tIdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock\n" >> ~/.ssh/config
# Git global config
git config --global user.name "Suzanne Aldrich"
git config --global user.email "suzanne@sjaconsulting.com"
git config --global github.user suzannealdrich
# git config --global github.token your_token_here
git config --global core.editor "code -w"
git config --global core.excludesfile ~/.gitignore_global
git config --global color.ui true
git config --global init.defaultBranch main
# Configure Git commit signing with SSH and 1Password
# See https://developer.1password.com/docs/ssh/git-commit-signing/
# git config --global user.signingkey your_key_here
# git config --global gpg.format ssh
# git config --global gpg.ssh.program your_signer_binary_here
# git config --global commit.gpgsign true
#!/usr/bin/sh
# Setup ~/.zshrc
cp ~/.system-config/config/dotfiles/zshrc ~/.zshrc
# Setup ~/.zshrc
cp ~/.system-config/config/dotfiles/zshrc ~/.zshrc
# Setup ~/.config/starship.toml
cp ~/.system-config/config/starship/starship.toml ~/.config/starship.toml
# Run ZSH so that everything intializes
zsh
# Change user shell to zsh
chsh
# PENDING
# zsh options
setopt NO_CASE_GLOB
setopt AUTO_CD
# show substituted commands in the prompt
setopt HIST_VERIFY
# enable zsh correction
# setopt CORRECT
# setopt CORRECT_ALL
# enable the default zsh completions
autoload -Uz compinit && compinit
# save command history
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
SAVEHIST=5000
HISTSIZE=2000
# share history across multiple zsh sessions
setopt SHARE_HISTORY
# append to history
setopt APPEND_HISTORY
# adds commands as they are typed, not at shell exit
setopt INC_APPEND_HISTORY
# expire duplicates first
setopt HIST_EXPIRE_DUPS_FIRST
# do not store duplications
setopt HIST_IGNORE_DUPS
# ignore duplicates when searching
setopt HIST_FIND_NO_DUPS
# removes blank lines from history
setopt HIST_REDUCE_BLANKS
export GPG_TTY=$(tty)
# enable git completion
zstyle ':completion:*:*:git:*' script ~/.zsh/git-completion.bash
fpath=(~/.zsh $fpath)
# case insensitive path-completion
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
# partial completion suggestions
zstyle ':completion:*' list-suffixes
zstyle ':completion:*' expand prefix suffix
# minimal aliases
alias ..='cd ..'
alias ...='cd ../..'
alias ls='ls -GwF'
alias ll='ls -alh'
# VSCode aliases
alias zshrc='code ~/.zshrc'
alias gitconfig='code ~/.gitconfig'
# add Google Cloud SDK command line tools to $PATH
#source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc"
#source "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc"
# export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock
export PATH="/usr/local/sbin:$PATH"
eval "$(starship init zsh)"
test -e /Users/suzannealdrich/.iterm2_shell_integration.zsh && source /Users/suzannealdrich/.iterm2_shell_integration.zsh || true
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# Configuration file for the Starship prompt
# See: https://starship.rs/config/
command_timeout = 60_000
[battery]
full_symbol = "πŸ”‹"
charging_symbol = "πŸ”Œ"
discharging_symbol = "⚑"
[[battery.display]]
threshold = 30
style = "bold red"
[character]
error_symbol = "[βœ–](bold red) "
[cmd_duration]
min_time = 10_000 # Show command duration over 10,000 milliseconds (=10 sec)
format = " took [$duration]($style)"
[directory]
truncation_length = 5
format = "[$path]($style)[$lock_symbol]($lock_style) "
[git_branch]
format = " [$symbol$branch]($style) "
symbol = "🌱 "
style = "bold yellow"
[git_commit]
commit_hash_length = 8
style = "bold white"
[git_state]
cherry_pick = "πŸ’ PICKING"
[git_status]
conflicted = "βš”οΈ "
ahead = "🏎️ πŸ’¨ Γ—${count}"
behind = "🐒 Γ—${count}"
diverged = "πŸ”± 🏎️ πŸ’¨ Γ—${ahead_count} 🐒 Γ—${behind_count}"
untracked = "πŸ›€οΈ Γ—${count}"
stashed = "πŸ“¦ "
modified = "πŸ“ Γ—${count}"
staged = "πŸ—ƒοΈ Γ—${count}"
renamed = "πŸ“› Γ—${count}"
deleted = "πŸ—‘οΈ Γ—${count}"
style = "bright-white"
format = "$all_status$ahead_behind"
[hostname]
ssh_only = false
format = "<[$hostname]($style)>"
trim_at = "-"
style = "bold dimmed white"
disabled = true
[memory_usage]
format = "$symbol[${ram}( | ${swap})]($style) "
threshold = 70
style = "bold dimmed white"
disabled = false
[package]
disabled = true
[python]
format = "[$symbol$version]($style) "
style = "bold green"
[rust]
format = "[$symbol$version]($style) "
style = "bold green"
[time]
time_format = "%T"
format = "πŸ•™ $time($style) "
style = "bright-white"
disabled = false
[username]
style_user = "bold dimmed blue"
show_always = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment