Personal Systems Branch / macOS Bootstrap
TECHNICAL MANUAL / MiMac — macOS Bootstrap
MIMAC-1 / PAGES: N/A
DEVELOPED ON: macOS 15
SOURCE REPO: MiloTGB/MiMac
1.

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.

Adapting for Your Use

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.

Key Repositories
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.

Source of Truth

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.

1.1

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.

2.1

Phase 1 — Setup

scripts/setup
PROC-01

Phase 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 $HOME as symlinks
  • Creates automatic backups of any existing files before linking
  • Links scripts/ and bin/ into ~/bin so 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
Managed Dotfiles
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 ~/
2.2

Phase 2 — Homebrew

scripts/brew-packages
PROC-02

Homebrew Installation Procedure

Installs Homebrew and all packages listed in the Brewfile.

What it does:

  • Installs Homebrew if not present
  • Runs brew bundle install from the Brewfile
  • Presents interactive prompts for packages that are new
  • Uses the mimac-picker TUI or gum to let you select which packages to accept

Usage:

make brew
2.3

Phase 3 — Post-Install

scripts/post-install
PROC-03

Post-Install Configuration Procedure

Configures installed apps. Must be run after Phase 2.

What it does:

  • Topgrade: Links assets/topgrade.toml to ~/.config/topgrade.toml
  • Browsers: Applies Chrome/Brave managed policies
  • App defaults: Applies defaults write settings for various apps
  • Preferences auto-pull: Automatically clones mimac-prefs if 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
Managed App Preferences
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
2.4

Full Install

Run all three phases in sequence:

make all        # Runs setup + brew + post-install
exec zsh        # Reload shell after setup
3.1

Brewfile Sync

make sync

Whenever you install a new Homebrew package, run make sync to record it in the Brewfile.

PROC-04

Brewfile Sync Procedure

Captures newly installed packages and updates the Brewfile.

How it works:

  1. Reads the Brewfile to build a list of already-tracked packages
  2. Runs brew leaves (top-level formulae) and brew list --cask
  3. Computes the diff — packages installed but not yet in the Brewfile
  4. Opens mimac-picker TUI for selection
  5. For each selected formula, prompts to choose which Brewfile section to add it to
  6. Casks are auto-assigned to the existing cask section
  7. 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
New: Prune Mode

The --prune flag detects packages in the Brewfile that are no longer installed and offers to remove them. Use -n for a safe preview.

3.2

Snapshot Preferences

make snapshot-prefs

After configuring an app, run make snapshot-prefs to capture and push the preferences.

PROC-05

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-prefs on GitHub

Usage:

make snapshot-prefs

Note: Snapshots are idempotent — if nothing changed, it reports "No changes to push."

3.3

Pull Preferences

make pull-prefs

Clones mimac-prefs into ~/.mimac/preferences/ if it doesn't exist, or fast-forward pulls if it does.

make pull-prefs
Automatic Pull

make post-install does this automatically if ~/.mimac/preferences/ is absent and your SSH key is authenticated with GitHub.

4.1

Pre-Migration Checklist

Run these steps on the old machine before you transfer.

PROC-06

Pre-Migration Procedure

  1. Sync the Brewfile:
    make sync ARGS=-c
  2. Snapshot app preferences:
    make snapshot-prefs

    Verify the push succeeded — you should see "Pushed to git@github.com:MiloTGB/mimac-prefs.git"

  3. Push any pending MiMac changes:
    cd ~/MiMac
    git status
    git push
  4. 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.

  5. 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.
4.2

New Machine Setup

PROC-07

Fresh Machine Installation Procedure

  1. Clone the MiMac repository:
    cd ~
    git clone git@github.com:MiloTGB/MiMac.git
    cd MiMac
  2. Run the full installation:
    make all
  3. Reload your shell:
    exec zsh
  4. Verify everything works:
    make doctor
SSH Key Required

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.

5.1

Command Reference

Make Targets
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
5.2

Troubleshooting

Common Issues

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