Setting up a new macOS machine
by Željko Filipin
tags: macos
Estimated reading time is 4 minutes.
I’ve recently had to set up a new macOS machine. I don’t trust syncing, so I do it manually. I’ve heard that macOS syncing works great these days from a few people, but I still prefer to set up a new machine manually. It might be just bad experiences from the past.
I have two reasons for the manual setup. First, it forces me to keep notes on software I install and configurations I make to the operating system and applications. Secondly, over the years the machine will accumulate a lot of unused software and settings. I like to start fresh every year or two. My notes have the essentials. If I set up a new machine and notice that an application or setting is missing, I update the notes.
I’ve mentioned to a coworker that I have notes on macOS setup and she asked if I could make it public.
App Store
The first thing I install and the only app I download from the App Store is Divvy, a window manager. I know there are others, but I’ve been using this one for more than a decade and it works just fine.
The second thing is Bitwarden password manager.
Homebrew
The next thing I install is Homebrew, a package manager for macOS. I use it to install pretty much everything else.
Firefox
Then I install my favorite browser, Firefox.
brew install firefox
Sign in to Firefox Account. That installs my favorite Firefox additions:
- Dark Reader
- DuckDuckGo Privacy Essentials
- Facebook Container
- uBlock Origin
- Unhook
- Croatian and English dictionaries
Applications
Then I install other apps I use regularly.
brew install 1password ack android-file-transfer deezer git-review google-chrome mr neovim node@16 p7zip ruby sync visual-studio-code vlc yousician zoom homebrew/cask/docker
Applications:
- 1Password - Password manager.
- ack - grep-like source code search tool.
- Android File Transfer - Transfer files between Mac and Android.
- Deezer - Music streaming.
- git-review - Submit changes to Gerrit for review.
- Google Chrome - Browser.
- mr - Multiple Repository management tool.
- Neovim - Vim-based text editor.
- Node.js - Programming language.
- 7-Zip - File archiver.
- Ruby - Programming language.
- Sync - File storage in the cloud.
- Visual Studio Code - Text editor.
- VLC - Multimedia player.
- Yousician - Learn to play an instrument.
- Zoom - Video communications.
- Docker - Containers all the way down.
Terminal
I make a few minor tweaks to the Terminal.
- General > On startup, open > New window with profile: Homebrew
- Profiles > Homebrew > Text > Font > Andale Mono 14
TextEdit
I don’t use TextEdit much, but when I use it, I only need plain text editing.
- New Document > Format > Plain text
- New Document > Font > Plain text font > Menlo Regular 14
macOS
I update macOS and check Finder preferences and System Preferences. I usually need to make a few tweaks.
Browsers
I prefer that browsers download to Desktop instead of Downloads folder, so I’ll make the change in Chrome, Firefox and Safari.
SSH
I mostly follow GitHub’s Generating a new SSH key and adding it to the ssh-agent page.
ssh-keygen -t ed25519 -C "computer-name"
eval "$(ssh-agent -s)"
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
ssh-add -l
Upload the public key to Gerrit, GitHub and GitLab.
Add Gerrit’s, GitHub’s and GitLab’s fingerprints to the known_hosts file.
cp ~/Documents/github/zeljkofilipin/dotfiles/.ssh/known_hosts ~/.ssh/known_hosts
Dotfiles
I don’t have such a huge investment in my dotfiles repository as some people I know, but I still find that repository very valuable. It makes copying configuration from one machine to another trivial.
mkdir -p ~/Documents/github/zeljkofilipin/
git clone git@github.com:zeljkofilipin/dotfiles.git ~/Documents/github/zeljkofilipin/dotfiles
cp ~/Documents/github/zeljkofilipin/dotfiles/.ssh/config.macos ~/.ssh/config
cp ~/Documents/github/zeljkofilipin/dotfiles/.gitconfig ~
cp ~/Documents/github/zeljkofilipin/dotfiles/.gitignore_global ~
cp ~/Documents/github/zeljkofilipin/dotfiles/.mrconfig ~/.mrconfig
cp ~/Documents/github/zeljkofilipin/dotfiles/.zprofile ~
cp ~/Documents/github/zeljkofilipin/dotfiles/.zshrc ~
mr
I use mr to automatically update more than 90 repositories every day. On a clean machine, the tool will clone all repositories.
mr u
MediaWiki-Docker
I use MediaWiki-Docker for the local MediaWiki development environment.
Fresh
I use Fresh to run MediaWiki tests on my machine. When the tool is installed, download the container.
fresh-node -env -net
Visual Studio Code
Did I mention I don’t trust much in syncing? So, I Copy Visual Studio Code configuration file from dotfiles.
cp ~/Documents/github/zeljkofilipin/dotfiles/Library/Application\ Support/Code/User/settings.json ~/Library/Application\ Support/Code/User/settings.json
I really like a few extensions:
Neovim
I prefer editing text in Vim. These days I usually use Neovim in Visual Studio Code. To use Neovim in Visual Studio Code install the VSCode Neovim extension.
On macOS, h, j, k and l movement keys may not repeat in visual mode when held. This is the fix.
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
Jenkins Job Builder
This is an optional step. It’s needed only on a machine that will use Jenkins Job Builder.
cd ~/Documents/gerrit/integration/jenkins-job-builder/config
pip3 install tox
Create an API token.
Create the jenkins_jobs.ini file:
[job_builder]
allow_duplicates=True
[jenkins]
user=zfilipin
password=API_TOKEN
url=https://integration.wikimedia.org/ci/
query_plugins_info=False
Reviewers
I would like to thank Kosta Harlan for reviewing the article and for advice on how to make it better.
Feedback
Thank you for reading. If you want to stay in touch please use the feed or send me an email.