Overview
MiMac is a personal, opinionated macOS bootstrap system tailored to my workflow and toolset. It automates the configuration of a Mac from a clean install, managing the shell environment, dotfiles, macOS system preferences, Homebrew packages, app settings, login items, and personal app preferences.
This project is built around a specific setup. If you fork it, you'll need to replace MiloTGB/mimac-prefs with your own private preferences repo, swap in your own dotfiles, and review the app lists in scripts/post-install and scripts/snapshot-prefs to match your environment.
| Repo | Location | Purpose |
|---|---|---|
| MiloTGB/MiMac | ~/MiMac | Public bootstrap repo |
| MiloTGB/mimac-prefs | ~/.mimac/preferences/ | Private app preferences |
The two-repo split keeps personal preference data (iTerm2 profiles, Audio Hijack settings, etc.) out of the public repo while still making them fully portable across machines.
As long as both repos are kept current, the entire setup can be fully restored on a new machine from scratch — nothing needs to be manually transferred. The repos are the source of truth.
Architecture
MiMac follows a three-phase installation process:
| Phase | Command | Purpose |
|---|---|---|
| Setup | make setup | Dotfiles, tools, macOS defaults |
| Homebrew | make brew | Install packages from Brewfile |
| Post-Install | make post-install | Configure apps, restore preferences |
Managed dotfiles include .aliases, .gitconfig, .zshrc, .zprofile, .zshenv, and a home Makefile for convenient command access.
Phase 1 — Setup
scripts/setupPhase 1 Setup Procedure
Sets up the foundational shell environment on a new or existing machine.
What it does:
- Installs Xcode Command Line Tools if not present
- Links everything in
dotfiles/into$HOMEas symlinks - Creates automatic backups of any existing files before linking
- Links
scripts/andbin/into~/binso tools are on your PATH - Applies macOS system preferences via
scripts/defaults.sh - Sets Zsh as the login shell
- Generates a rollback script at
~/.mimac/defaults-rollback.sh
Usage:
make setup # Full setup
make setup --dry-run # Preview changes
make dotfiles # Link dotfiles only
make tools # Link scripts/bin only
make defaults # Apply macOS defaults only
make trackpad # Include trackpad settings
| File | Purpose |
|---|---|
| .aliases | Shell aliases and functions |
| .gitconfig | Git configuration |
| .hushlogin | Suppresses "Last login" terminal message |
| .zprofile | Zsh login shell profile |
| .zshenv | Zsh environment variables |
| .zshrc | Zsh interactive shell config (with lazy-loading NVM) |
| Makefile | MiMac commands available from ~/ |
Phase 2 — Homebrew
scripts/brew-packagesHomebrew Installation Procedure
Installs Homebrew and all packages listed in the Brewfile.
What it does:
- Installs Homebrew if not present
- Runs
brew bundle installfrom the Brewfile - Presents interactive prompts for packages that are new
- Uses the mimac-picker TUI or
gumto let you select which packages to accept
Usage:
make brew
Phase 3 — Post-Install
scripts/post-installPost-Install Configuration Procedure
Configures installed apps. Must be run after Phase 2.
What it does:
- Topgrade: Links
assets/topgrade.tomlto~/.config/topgrade.toml - Browsers: Applies Chrome/Brave managed policies
- App defaults: Applies
defaults writesettings for various apps - Preferences auto-pull: Automatically clones
mimac-prefsif SSH is authenticated - Plist imports: Imports personal preference plists (non-destructive)
- App Support restore: Restores Loopback and SoundSource configuration files
- Login items: Registers login items for installed apps
Usage:
make post-install
| App | Configuration |
|---|---|
| iTerm2 | Plist imported |
| Loopback | Plist + App Support files |
| SoundSource | Plist + App Support files |
| Audio Hijack | Plist imported |
| BetterSnapTool | Plist imported |
| Ice | Plist imported |
| Raycast | Plist imported |
| Stats | Plist imported |
| Farrago | Plist imported |
| Piezo | Plist imported |
Full Install
Run all three phases in sequence:
make all # Runs setup + brew + post-install
exec zsh # Reload shell after setup
Brewfile Sync
make syncWhenever you install a new Homebrew package, run make sync to record it in the Brewfile.
Brewfile Sync Procedure
Captures newly installed packages and updates the Brewfile.
How it works:
- Reads the Brewfile to build a list of already-tracked packages
- Runs
brew leaves(top-level formulae) andbrew list --cask - Computes the diff — packages installed but not yet in the Brewfile
- Opens mimac-picker TUI for selection
- For each selected formula, prompts to choose which Brewfile section to add it to
- Casks are auto-assigned to the existing cask section
- Inserts each entry alphabetically within its section
Usage:
make sync # Interactive selection
make sync ARGS=-n # Dry run preview
make sync ARGS=-c # Auto-commit after update
make sync ARGS="-p" # Prune stale packages
make sync ARGS="-p -n" # Prune dry-run
The --prune flag detects packages in the Brewfile that are no longer installed and offers to remove them. Use -n for a safe preview.
Snapshot Preferences
make snapshot-prefsAfter configuring an app, run make snapshot-prefs to capture and push the preferences.
Preference Snapshot Procedure
Exports app preferences and pushes to the private preferences repo.
What it does:
- Exports the preference plist for each of the 15 managed apps using
defaults export - Copies Loopback and SoundSource Application Support files
- Commits all changes to
~/.mimac/preferences/with a timestamped message - Pushes to
MiloTGB/mimac-prefson GitHub
Usage:
make snapshot-prefs
Note: Snapshots are idempotent — if nothing changed, it reports "No changes to push."
Pull Preferences
make pull-prefsClones mimac-prefs into ~/.mimac/preferences/ if it doesn't exist, or fast-forward pulls if it does.
make pull-prefs
make post-install does this automatically if ~/.mimac/preferences/ is absent and your SSH key is authenticated with GitHub.
Pre-Migration Checklist
Run these steps on the old machine before you transfer.
Pre-Migration Procedure
-
Sync the Brewfile:
make sync ARGS=-c -
Snapshot app preferences:
make snapshot-prefsVerify the push succeeded — you should see "Pushed to git@github.com:MiloTGB/mimac-prefs.git"
-
Push any pending MiMac changes:
cd ~/MiMac git status git push -
Verify SSH authentication:
ssh -T git@github.com # Expected: Hi MiloTGB! You've successfully authenticated...The new machine needs your SSH key to auto-pull mimac-prefs.
-
Note anything not covered by MiMac:
- App Store apps (reinstall from Purchases)
- Software licenses
- Manual system settings not captured by
defaults write - VPN configurations, certificates, etc.
New Machine Setup
Fresh Machine Installation Procedure
-
Clone the MiMac repository:
cd ~ git clone git@github.com:MiloTGB/MiMac.git cd MiMac -
Run the full installation:
make all -
Reload your shell:
exec zsh -
Verify everything works:
make doctor
Make sure your SSH key is added to GitHub before running make all. Post-install will automatically clone your private preferences repo if SSH authentication is configured.
Command Reference
| Command | Description |
|---|---|
| make all | Full install (setup + brew + post-install) |
| make setup | Phase 1: shell, dotfiles, macOS defaults |
| make brew | Phase 2: install Homebrew packages |
| make post-install | Phase 3: configure apps and login items |
| make sync | Update Brewfile with new packages |
| make snapshot-prefs | Export and push app preferences |
| make pull-prefs | Clone or pull app preferences |
| make dotfiles | Link dotfiles only |
| make tools | Link scripts/bin only |
| make defaults | Apply macOS defaults |
| make trackpad | Apply defaults including trackpad |
| make uninstall | Remove symlinks and undo setup |
| make nuke | Complete removal (dry-run by default) |
| make doctor | Run diagnostics |
| make status | Show installation status |
| make update | Upgrade all packages (topgrade) |
| make harden | Apply security hardening |
| make manual | Regenerate this documentation |
Troubleshooting
Homebrew permission errors:
make fix-exec
sudo chown -R $(whoami) $(brew --prefix)/*
Symlink conflicts:
make uninstall # Remove existing symlinks
make setup # Re-link dotfiles
Preferences not importing:
Ensure ~/.mimac/preferences/ exists and contains plists. Run make pull-prefs to clone the repo.
SSH authentication failed:
ssh -T git@github.com
# Add your SSH key to GitHub if needed
For diagnostic information, run:
make doctor
make status