Docs: https://faisalazam.github.io/mac-dev-bootstrap/
This repo bootstraps a macOS dev machine with Homebrew + symlinked dotfiles. It is safe to rerun, and it keeps personal identity and secrets out of git.
- Installs/updates Homebrew and applies the
Brewfile - Links repo-managed config into your home directory
git/gitconfig->~/.gitconfiggit/gitignore_global->~/.gitignore_globalzsh/zshrc->~/.zshrczsh/p10k.zsh->~/.p10k.zshzsh/zsh_aliases->~/.zsh_aliasesssh/config->~/.ssh/config
- Installs Oh My Zsh + Powerlevel10k (if missing)
- Prompts for Git identity and writes it to
~/.gitconfig.local - Configures Java via
jenvand checks Java/Maven version alignment - Optionally runs an organization overlay from
orgs/<org_name>/setup.sh
git clone git@github.com:faisalazam/mac-dev-bootstrap.git ~/orgs/personal/mac-dev-bootstrap
cd ~/orgs/personal/mac-dev-bootstrap
./setup-mac.shsetup-mac.sh is the main entry point. It installs dependencies, applies dotfiles, and runs sanity checks.
To include an org-specific overlay (example: TPG):
cd ~/orgs/personal/mac-dev-bootstrap
ORG_BOOTSTRAP=tpg ./setup-mac.shThis runs orgs/tpg/setup.sh after base setup.
If ORG_BOOTSTRAP is not set and the script is running in an interactive terminal,
setup-mac.sh shows available overlays under orgs/ and lets you choose one.
Each overlay lives under orgs/<org_name>/ and can include:
setup.shfor idempotent org setupBrewfilefor org-specific toolsscripts/for onboarding tasks (certs.sh,vpn.sh, etc.)zsh/<org>.zshfor org-only shell exports (linked to${ORG_ZSH_DIR:-~/.zsh_org.d}/${ORG_ZSH_PREFIX:-.zsh_}<org>)
zsh/zshrc dynamically sources ${ORG_ZSH_DIR:-~/.zsh_org.d}/${ORG_ZSH_PREFIX:-.zsh_}*, so multiple org overlays can coexist.
This keeps the base setup generic while allowing per-company extensions.
cd ~/orgs/personal/mac-dev-bootstrap
./bin/bootstrap.shUse this when you only want to relink configs or update Git identity.
If ssh -T git@github.com fails, run:
cd ~/orgs/personal/mac-dev-bootstrap
./bin/github-ssh-setup.sh
ssh -T git@github.comThis script creates ~/.ssh/id_ed25519_github and prints the public key so you can add it in GitHub settings.
Java is managed with jenv.
- Installed JDKs are Temurin 26 and 21 (from
Brewfile) - Default global Java is set to 26 in
setup-mac.sh ~/.zshrcexportsJAVA_HOMEfromjenv prefix, sojavaandmvnstay aligned
To switch versions later:
jenv local 21
jenv global 21- Do not commit private keys or machine-specific secrets
~/.gitconfig.localstays local and is intentionally not tracked- If you change SSH key naming or Java versions, update related files together:
- SSH:
ssh/configandbin/github-ssh-setup.sh - Java:
Brewfileandsetup-mac.sh
- SSH:
This setup intentionally does not override shell-level color variables (LSCOLORS, LS_COLORS). Terminal appearance is
expected to be managed via the iTerm2 profile.
For best readability with Powerlevel10k and common CLI tools, use a dark color preset in iTerm2:
iTerm2 → Settings → Profiles → Colors → Color Preset
Recommended presets:
- Dark Background
- Smoooooth
- Solarized Dark
- Tango Dark
If colors look hard to read after setup, adjusting the iTerm2 color preset is usually sufficient.
This repository includes a .gitattributes file under git/gitattributes as a template.
It is not used automatically by Git. Instead, it is intended to be copied into individual project repositories as needed.
The primary purpose of this template is to:
- enforce LF (
\n) line endings - avoid CRLF-related issues across macOS, Linux, Windows, and CI
- ensure consistent behavior for shell scripts and test fixtures
When setting up a new project repository, copy it to the repo root:
cp ~/mac-dev-bootstrap/git/gitattributes .gitattributesThen commit it:
git add .gitattributes
git commit -m "Add .gitattributes to normalize line endings"Line-ending rules should be explicit and versioned per repository. Keeping .gitattributes local to each project avoids hidden global behavior and makes expectations clear to all contributors.