This repository contains everything to bootstrap my Macbook Pro.
- Current: Macbook Pro 14 inch, M1 Max, 32 GB RAM, 2021 M1 Silicon architecture.
- The previous setup for the 16 inch, 2019 model can be found at this commit. The setup is explained in-depth in dotfiles - Document and automate your Macbook setup.
The current ZSH theme is Powerlevel10k, detailed in this blog post.
In addition to the files stored in this repository, the following instructions are needed to fully setup a Macbook Pro.
Install iterm2 manually from the website, drag it into the Applications folder, start it and add it to the deck.
- Download the Dark and White profiles from this repository
- Navigate into
Settings > Profile
. - At the bottom, click on
Other Actions
and selectImport JSON profiles
. Import the downloadedDark.json
file. - Mark
dark
profile and selectOther Actions > Set as default
.
Powerlevel10k fonts for Oh-My-ZSH terminal:
- Download the font files from https://github.com/romkatv/powerlevel10k#manual-font-installation (backup in fonts/).
- Double-click to open them all to follow "Install Font".
Navigate into Settings > Security and Privacy > App Management
and allow iTerm2 to modify apps. Otherwise you will see this warning on macOS Ventura 13.4.1.
Warning: Your terminal does not have App Management permissions, so Homebrew will delete and reinstall the app.
This may result in some configurations (like notification settings or location in the Dock/Launchpad) being lost.
To fix this, go to Settings > Security and Privacy > App Management and turn on the switch for your terminal.
Install it on the command line first, it will ask for permission.
xcode-select --install
sudo vim /private/etc/sudoers.d/mfriedrich
mfriedrich ALL=(ALL) NOPASSWD: ALL
Use Google drive and Chrome profile sync to migrate backup data.
Copy the following private secret files in your home directory:
- SSH Keys
- GPG Keys
- GitHub/GitLab Tokens in
.env
- Custom settings for OhMyZSH
cd backup/
cp -r .ssh .gnupg .env .oh-my-zsh $HOME/
Note:
The
dotenv
plugin is enabled in OhMyZSH which automatically reads the.env
tokens from the user's home directory.
These steps contain all the remaining setup steps: Homebrew, macOS system settings, applications.
git clone https://gitlab.com/dnsmichi/dotfiles.git
cd dotfiles
Sync the files into the home directory.
./bootstrap.sh
Apply macOS settings. Review the file before applying.
./.macos
Install Homebrew and OhMyZSH.
./brew_once.sh
Install tools and applications with Homebrew bundle.
brew bundle
This makes use of the Brewfile definitions.
mas is used to install apps from the app store, and is itself installed with Homebrew first in the Brewfile.
$ cat Brewfile
brew "mas"
...
mas "Slack", id: 803453959
Note: GitLab uses Jamf for endpoint management which provides a self-service application to manage essential apps. Since 2023-06, I am using this method in favor of Homebrew mas.
These tools are managed outside of Homebrew, and require additional work and documentation.
- Google Chrome - tips handbook
- 1Password 8
- Zoom (note the special download location for Apple M1 Silicon)
- Raycast has automated updates enabled.
- VS Code has automated updates enabled (extensions require newer versions).
- Rectangle Pro for window management
- Java 18+ Open Source
- Grammarly Desktop (team license)
- Adobe Creative Cloud (team license)
Configuration: vscode/settings.json (cmd shift p, search for settings json
).
Initial setup:
cp vscode/settings.json ~/Library/Application\ Support/Code/User/
Notable changes from the default configuration:
- Auto-save enabled:
"files.autoSave": "afterDelay",
- Word-wrap enabled:
"editor.wordWrap": "on",
- Change font family to
meslolgs nf
to print ZSH icons in the VS Code terminal:"terminal.integrated.fontFamily": "meslolgs nf",
- GitLab Duo Code Suggestions enabled:
"gitlab.aiAssistedCodeSuggestions.enabled": true,
- GitLab Workflow extension debug enabled:
"gitlab.debug": true,
Sync:
cp ~/Library/Application\ Support/Code/User/settings.json vscode/
Run the following script to install VS Code extensions:
./vscode-extensions-install.sh
You can regenerate the list of extensions using the following command:
code --list-extensions | xargs -L 1 echo code --install-extension > vscode-extensions-install.sh
asdf is installed with Homebrew and helps manage different programming languages and environments.
NodeJS:
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
asdf list all nodejs
asdf install nodejs 20.3.0
asdf local nodejs 20.3.0
For Macbook refreshments, enable the Profile sync functionality and mirror bookmarks, history, auto-completion, etc. This is essential for efficiency.
Extensions:
- Okta
- Zoom
- 1Password
- Google Docs Offline
- uBlock Origin
- Buffer (social media queue)
- Window Resizer (virtual screensharing that requires specific resolutions)
Open the extensions and record keyboard shortcut commands. I use the emoji search very extensively, and have recorded cmd + ` for faster access.
CLI Tools:
- Rancher Desktop (provides local Kubernetes, and
docker
compatible CLI) - manual download docker-compose
,vagrant
,lima
,podman
via Brewfile
Cloud:
CLI tools managed with Homebrew in Brewfile: Google Cloud, AWS, Hetzner Cloud, Civo Cloud.
Kubernetes clusters are managed in GKE, GitLab community group.
In 2022, I decided to switch to Rancher Desktop, and evaluate podman, nerdctl, etc. in the future. More tips can be found in the GitLab handbook.
Vagrant and Lima are installed for local Linux VM demos and workshops. Vagrant on Apple M1 Silicon needs Rosetta 2 being installed.
$ sudo softwareupdate --install-rosetta --agree-to-license
I prefer lima for Linux VM management, for example in https://gitlab.com/gitlab-de/workshops/observability/learn-ebpf-2023
Note: VirtualBox requires the developer preview for Apple Silicon M1. This cannot be managed with Homebrew. Download and install it, it may contain bugs and is far from production ready: https://forums.virtualbox.org/viewtopic.php?f=8&t=107344 2023-06-06 status: Cannot boot Ubuntu 23.04 via Vagrant.
These are manual settings as they require user awareness.
Enable Encryption (required for GitLab team members with Jamf. See here for detailed instructions.
1Password8 overrides the screenshot shortcut cmd+shift+4+space
by default. Replace it with something else, or clear it in Settings > General > Keyboard Shortcuts
.
Follow https://developer.1password.com/docs/cli/shell-plugins/aws/ to
- Install the 1Password CLI
- Connect 1Password CLI with the 1Password app
- Run
op signin
andop plugin init aws
The required ZSH environment is sourced via .oh-my-zsh/custom/1password.zsh.
Settings > Keyboard > Keyboard Shortcuts
:
- Disable all Spotlight options in preparation for enabling Raycast as default shortcut using
cmd + space
.
Start Raycast from the Applications folder in Finder, and change the hotkey to Cmd+Space
.
Ensure that Spotlight is disabled in the system preferences.
Open Finder and navigate into Settings > Sidebar
to add
- User home (user name)
- System root (Macbook name)
https://handbook.gitlab.com/handbook/tools-and-tips/zoom/
Settings > General
: Untick Ask me to confirm when I leave a metting
Settings > Audio
: Mute my mic when joining
Settings > Keyboard Shortcuts
: Mute/Unmute my audio: cmd 1
.
- Google Chrome
- JetBrains Toolbox (license required)
- NTFS for Mac (license required, I own a private license)
- Spotify (account required)
- Telegram (account required)
Following the GitLab tools and tipshandbook.
Managed as casks in Brewfile.
- Firefox (in order to reproduce UX bugs)
- VLC
- Wireshark
Documentation for initial settings:
- Create a new profile in
Settings > Profile
namedDark
Colors > Color presets > Dark background
Session > Status bar enabled
andConfigure Status Bar
. Addgit state
,CPU utilization
,Memory utilization
. ClickAuto-Rainbow
.
- Mark
dark
profile and selectOther Actions > Set as default
. - Export the Dark profile as JSON and upload into the iterm2 directory.
Note: This is persisted in the iterm2 profile already.
Navigate to iterm2 Settings > Profiles > Text > Font
and search for Meslo
to select the font. Save and restart iTerm2.
More insights can be found in these lists:
Follow the one-line installation and use asdf (requirement).
The CI/CD pipelines for GitLab docs use linting which can be installed locally to test problems faster.
yarn global add markdownlint-cli2
yarn global add markdownlint-cli
asdf plugin add vale && asdf install vale
The VS Code editor integration is managed through vscode-extensions-install.sh.
cd ~/dev/work/gitlab-org/gitlab
yarn install
./scripts/lint-doc.sh
Install Golang to setup the development environment. Export the variables GITLAB_TOKEN
and GITLAB_TEST_HOST
to run all integration tests.
export GITLAB_TOKEN=xxx
# GitLab CLI dev tests
# https://gitlab.com/dnsmichi/test
export GITLAB_TEST_HOST=https://gitlab.com
make
make test
Anything that runs in the infrastructure and needs to be automated.
See ansible/ for details.
brew upgrade
cd ~/.oh-my-zsh
git pull
cd ~/.oh-my-zsh/custom/themes/powerlevel10k
git pull
On major version upgrades, binaries might be incompatible or need a local rebuild. You can enforce a reinstall by running the two commands below, the second command only reinstalls all application casks.
brew reinstall $(brew list)
brew reinstall $(brew list --cask)
When Xcode and compilers break, re-install the command line tools.
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
xcrun: error: invalid active developer path
You need to explicity agree to the terms of services for the developer tools.
xcode-select --install
The settings in .macos use macOS internal APIs on the command line. Sometimes the configuration settings change, for example with the Trackpad on macOs Ventura.
To debug and capture which settings are in effect, create a new Git repository somewhere, and persist the system settings output.
mkdir $HOME/dev/work/system-settings
cd $HOME/dev/work/system-settings
git init
defaults read > settings.txt
git add settings.txt
git commit -av -m "Initial settings"
Then navigate into the Systems settings GUI, change parameters, export the system settings into the same file, and analyze the Git diff to figure out the correct parameter names and values.
defaults read > settings.txt
git diff
Example with Trackpad and right-click:
"com.apple.AppleMultitouchTrackpad" = {
ActuateDetents = 1;
- Clicking = 0;
+ Clicking = 1;
DragLock = 0;
Dragging = 0;
FirstClickThreshold = 1;
ForceSuppressed = 0;
SecondClickThreshold = 1;
- TrackpadCornerSecondaryClick = 0;
+ TrackpadCornerSecondaryClick = 2;
TrackpadFiveFingerPinchGesture = 2;
TrackpadFourFingerHorizSwipeGesture = 2;
TrackpadFourFingerPinchGesture = 2;
@@ -463,7 +464,7 @@
TrackpadHorizScroll = 1;
TrackpadMomentumScroll = 1;
TrackpadPinch = 1;
- TrackpadRightClick = 1;
+ TrackpadRightClick = 0;
TrackpadRotate = 1;
TrackpadScroll = 1;
TrackpadThreeFingerDrag = 0;
Requiring the current settings to be changed to https://gitlab.com/dnsmichi/dotfiles/-/commit/f16809989ba2d65fc73e1274356b6f2c6cfde1db in June 2023.
The magic keyboard with Touch ID does not work after the Macbook went to sleep.
- https://www.reddit.com/r/mac/comments/13hd4aa/magic_keyboard_with_touch_id_no_working_after/
- https://www.reddit.com/r/macmini/comments/12cw4mf/touch_id_issues_on_mac_mini_m2/
- https://support.apple.com/en-us/HT212225#:~:text=For%20Magic%20Keyboard%20with%20Touch,Restart%20your%20Mac
The main repository is hosted on GitLab.com, mirrored to GitHub.com: https://gitlab.com/dnsmichi/dotfiles