Every way to automate a Mac setup, ranked by mass of YAML you'll write

Published: (February 15, 2026 at 01:55 AM EST)
6 min read
Source: Dev.to

Source: Dev.to

The Problem

I’ve set up more Macs than I care to admit—personal machines, work laptops, loaners, and even that one time I rage‑wiped my drive at 2 am because my Python environment was beyond repair.

Every time it’s the same story:

  • Open Terminal → Desert. No git, no node, no docker.
  • Finder hides file extensions.
  • The Dock takes forever to auto‑hide.
  • All your aliases are gone.

Two hours of brew install later you’ve got maybe half your tools back. A week later you realize you forgot jq. Two weeks later every commit at your new job says “unknown” because you never set your Git email.

I’ve tried every level of automation to fix this. Here’s what I found.

Your Setup Is Bigger Than You Think

I counted once—83 things across 8 categories:

CategoryExamples
Package managerHomebrew (always step zero)
CLI tools (30+)ripgrep, fd, fzf, bat, eza, lazygit, gh, jq, delta, zoxide
GUI apps (15+)VS Code, Warp, Raycast, Rectangle, OrbStack, Chrome, Arc…
Languages & runtimesNode, Go, Python, Rust, plus pnpm/uv/cargo
ShellOh‑My‑Zsh, Starship, plugins, your .zshrc
Dotfiles.gitconfig, .vimrc, .ssh/config
Git identityThe two lines everyone forgets every time
macOS preferencesdefaults write commands for Dock speed, Finder, key repeat

If you think your setup is “just Homebrew and VS Code,” you’re under‑counting by about 70 %.

Automation Options

1. Brewfile

Simplest option. Homebrew has it built‑in.

# Export
brew bundle dump --file=~/Brewfile

# Restore
brew bundle --file=~/Brewfile

I used a Brewfile for about a year—zero dependencies, easy to read, just drop it in a repo and you’re done.

Limitation: Handles only Homebrew packages. No shell config, macOS prefs, or Git identity. You’re automating roughly 30 % of the job.

2. Shell script

Next step up. Write a Bash script that does everything.

#!/usr/bin/env bash
set -euo pipefail

# Packages
brew install ripgrep fd bat fzf node go lazygit gh
brew install --cask visual-studio-code warp raycast

# macOS preferences
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
defaults write com.apple.dock autohide-delay -float 0

# Git identity
git config --global user.name  "Your Name"
git config --global user.email "you@example.com"

Pros: Covers more ground.
Cons: Breaks more often. A network hiccup can leave the script half‑finished; rerunning it produces “already installed” warnings; Oh‑My‑Zsh may complain, and Git config overwrites existing values.

Someone on Reddit responded with a 200‑line version, which proved the point: if you need that many lines of Bash to set up a laptop, Bash might not be the right tool.

3. chezmoi

A dotfile manager that templates your configs so one repo works across machines and can encrypt secrets.

chezmoi init --apply your-github-username

Pros: Great for multiple machines/OSes; handles dotfiles elegantly.
Cons: Doesn’t install software—you still need a Brewfile. The learning curve is higher than a simple script; I spent more time learning its directory conventions than actually setting up my dotfiles.

4. nix-darwin

The nuclear option. Full declarative config for your entire Mac.

{ pkgs, ... }:

{
  environment.systemPackages = with pkgs; [
    ripgrep fd bat fzf nodejs go
  ];

  homebrew.casks = [
    "visual-studio-code"
    "warp"
  ];

  system.defaults.dock.autohide = true;
}

Pros: Elegant, single source of truth, rollback built‑in.
Cons: Steep learning curve; you need to understand Nix’s language, package manager, and philosophy. I spent a weekend on the Nix discourse forums just to get my shell loading.

Best for: People already in the Nix ecosystem.
If you’re new: Budget 1–2 weeks before it starts paying off.

5. Ansible

Jeff Geerling’s mac‑dev‑playbook is the popular Ansible option.

  • Pros: Idempotent, works well at scale.
  • Cons: Writing enterprise‑level YAML to install VS Code on a personal laptop feels absurd. When a playbook fails, the error messages read like server logs.

Best for: 500 + corporate laptops.
Overkill for: One developer.

Comparison Table

Feature / ToolBrewfileShell scriptchezmoinix-darwinAnsible
Packages
GUI apps
Shell configDIYDIY
macOS prefsDIY
DotfilesDIYDIY
Rollback
Idempotent
Learning curve5 min10 min1 hour1–2 weeks2–3 hours
Coverage~30 %~70 %~20 %~90 %~70 %

No single tool covers everything. Most people end up combining two or three.

My Solution: OpenBoot

I got tired of juggling tools and built OpenBoot – a TUI that handles:

  • Packages (Homebrew)
  • GUI apps
  • Shell configuration
  • macOS preferences
  • Git identity

Biased, of course, but the comparison above shows where it fits.

The 2026 CLI Toolkit

These tools keep showing up in every setup I see:

CategoryTools
Search / Navigationripgrep, fd, fzf, zoxide
File viewingbat, eza
JSONjq
Gitdelta, lazygit
Othersgh (GitHub CLI), lazygit (interactive rebasing)

If you’re building a new Mac from scratch, make sure these are in your Brewfile (or equivalent) – they’ll save you countless hours.

The 2026 GUI Picks

VS Code still wins on extensions. Cursor is the first editor that’s actually pulling me away.

  • Warp – terminal
  • Raycast – over Alfred (clipboard history alone)
  • Rectangle – window management, free

OrbStack replaced Docker Desktop and my fans went quiet. If you’re still on Docker Desktop, just try it.

Newer stuff that stuck

  • Ghostty – stupid fast native terminal
  • Zed – great for massive files
  • Ollama – local LLMs for plane rides
  • uv – Python finally has a sane package manager
  • Bun – replaced Node for throwaway scripts

What’s your setup? I’m curious how many people actually use nix-darwin day‑to‑day vs. just a Brewfile. And is anyone still using mackup, or has everyone moved on?

Full version with more code examples and detailed walkthroughs:
blog.fullstackjam.com/2026/mac-setup-automation-guide-2026

0 views
Back to Blog

Related posts

Read more »

bash scripting: summary

Bash Scripting Overview A bash script is a plain‑text file that contains a sequence of commands executed by the Bash Bourne‑Again SHell interpreter, line by li...