mac-dev-bootstrap

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.

What this sets up

Full setup (new machine)

git clone git@github.com:faisalazam/mac-dev-bootstrap.git ~/orgs/personal/mac-dev-bootstrap
cd ~/orgs/personal/mac-dev-bootstrap
./setup-mac.sh

setup-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.sh

This 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.

Organization overlays

Each overlay lives under orgs/<org_name>/ and can include:

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.

Reapply dotfiles only

cd ~/orgs/personal/mac-dev-bootstrap
./bin/bootstrap.sh

Use this when you only want to relink configs or update Git identity.

GitHub SSH setup

If ssh -T git@github.com fails, run:

cd ~/orgs/personal/mac-dev-bootstrap
./bin/github-ssh-setup.sh
ssh -T git@github.com

This script creates ~/.ssh/id_ed25519_github and prints the public key so you can add it in GitHub settings.

Java and Maven versions

Java is managed with jenv.

To switch versions later:

jenv local 21
jenv global 21

Safety notes

Terminal Colors (iTerm2)

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:

If colors look hard to read after setup, adjusting the iTerm2 color preset is usually sufficient.

.gitattributes template

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:

Usage

When setting up a new project repository, copy it to the repo root:

cp ~/mac-dev-bootstrap/git/gitattributes .gitattributes

Then commit it:

git add .gitattributes
git commit -m "Add .gitattributes to normalize line endings"

Why this is not global

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.