Homebrew First - My Quest for App Sync Nirvana

By David Cruz on Jan 10, 2025
#Homebrew#macOS#Developer Tools#Automation#Package Management
Terminal with Homebrew commands

Homebrew First: My Quest for App Sync Nirvana

As a developer who constantly switches between machines, I’ve developed a simple rule: Homebrew first. Before I even think about visiting a website to download an app, I check if it’s available through Homebrew. This single decision has revolutionized how I manage software across my development environments.

When combined with Chezmoi for dotfile management, Homebrew gets me tantalizingly close to the holy grail of development setup: complete environment synchronization. But as you’ll see, even in 2024, we’re still chasing that perfect app sync nirvana.

Why Homebrew First?

The Old Way: Download Hell

Remember the pre-Homebrew days? Setting up a new Mac meant:

  1. Visit dozens of websites to download individual apps
  2. Navigate different installers (.dmg, .pkg, .zip, drag-and-drop)
  3. Remember which apps you actually use
  4. Track down specific versions when needed
  5. Manually check for updates across all apps

It was tedious, error-prone, and impossible to automate effectively.

The Homebrew Way: Declarative Software Management

With Homebrew, software installation becomes declarative and reproducible:

# Instead of visiting websites...
brew install --cask visual-studio-code
brew install --cask docker
brew install --cask notion
brew install node
brew install git

Even better, with a Brewfile, you can declare your entire software stack:

# Brewfile - My complete software environment
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"

# Essential CLI tools
brew "git"
brew "node"
brew "node"            
brew "nvm"             
brew install "node"
brew "yarn"
brew "watchman"
brew "go"
brew "rust"
brew "chezmoi"

# Development tools
brew "neovim"
brew "tmux"
brew "fzf"
brew "ripgrep"
brew "bat"
brew "exa"
brew "fd"
brew "jq"
brew "httpie"

# Applications
cask "visual-studio-code"
cask "docker"
cask "iterm2"
cask "notion"
cask "slack"
cask "spotify"
cask "1password"
cask "google-chrome"
cask "firefox"

# Fonts
cask "font-fira-code-nerd-font"
cask "font-jetbrains-mono-nerd-font"

# Quick Look plugins
cask "qlmarkdown"
cask "quicklook-json"
cask "quicklook-csv"

Integration with Chezmoi: The Power Combo

The real magic happens when you combine Homebrew with Chezmoi. My Brewfile is managed by Chezmoi, which means:

  1. Version controlled: Every change to my software stack is tracked
  2. Machine synchronized: All my computers have identical software
  3. Automated installation: New machines get everything installed automatically

Here’s how I set it up:

# Add Brewfile to chezmoi
chezmoi add ~/.config/homebrew/Brewfile

# Create a run_onchange script for automatic installation
# ~/.local/share/chezmoi/run_onchange_install-packages.sh.tmpl
#!/bin/bash
{{ if eq .chezmoi.os "darwin" -}}
echo "📦 Installing/updating Homebrew packages..."
brew bundle install --file ~/.config/homebrew/Brewfile --cleanup
echo "✅ Homebrew packages updated"
{{ end -}}

Now, whenever I modify my Brewfile on any machine and sync with Chezmoi, all my computers automatically install the new software!

My Brewfile Categories

I organize my Brewfile into logical sections:

CLI Development Tools

# The foundation of my command-line workflow
brew "git"           # Version control
brew "gh"            # GitHub CLI
brew "neovim"        # Editor
brew "tmux"          # Terminal multiplexer
brew "fzf"           # Fuzzy finder
brew "ripgrep"       # Better grep
brew "bat"           # Better cat
brew "exa"           # Better ls
brew "fd"            # Better find

Programming Languages & Runtimes

brew "node"          # JavaScript runtime
brew "python"        # Python interpreter
brew "go"            # Go compiler
brew "rust"          # Rust toolchain
brew "deno"          # Modern JS/TS runtime

GUI Applications

cask "visual-studio-code"    # Primary editor
cask "docker"                # Containerization
cask "iterm2"                # Better terminal
cask "notion"                # Note-taking
cask "bitwarden"             # Password manager

The Reality: Manual Install Zone

Here’s where the dream meets reality. Despite Homebrew’s extensive catalog, I still find myself manually installing several apps:

Apps That Require Manual Installation

Design & Creative Tools:

  • Figma (Desktop app via their website)
  • Sketch (Mac App Store only)

Specialized Development Tools:

  • Xcode (Mac App Store, too large for cask)
  • Some company-specific tools (Internal distribution)

Enterprise Software:

  • Microsoft Office (Complex licensing)
  • Zoom (Company-managed versions)
  • VPN clients (Company-specific configurations)

The Manual Install Workflow

For apps I can’t get through Homebrew, I’ve developed a process:

  1. Document in a separate list - I keep a MANUAL_INSTALLS.md in my dotfiles
  2. Automate where possible - Some can be scripted with mas (Mac App Store CLI)
  3. Use automation tools - Tools like mackup for some app settings backup
# Mac App Store apps via mas
brew "mas"
# Then in Brewfile:
mas "Xcode", id: 497799835

Advanced Homebrew Techniques

Brewfile Management Strategies

Environment-Specific Brewfiles:

# Work machine
Brewfile.work

# Personal machine  
Brewfile.personal

# Shared base
Brewfile.base

Conditional Installation:

# Install only on work machines
if ENV['USER'] == 'work_username'
  cask "slack"
  cask "microsoft-teams"
end

Homebrew Maintenance Scripts

I’ve created scripts to keep everything clean and updated:

#!/bin/bash
# brew-maintenance.sh

echo "🍺 Homebrew Maintenance Script"

# Update Homebrew and all packages
brew update && brew upgrade

# Clean up old versions
brew cleanup

# Check for issues
brew doctor

# Update App Store apps
mas upgrade

# Sync with Brewfile
brew bundle check --file ~/.config/homebrew/Brewfile || \
brew bundle install --file ~/.config/homebrew/Brewfile

echo "✅ Homebrew maintenance complete"

The Quest Continues: Future Dreams

While Homebrew gets me 80% of the way to app sync nirvana, I’m still dreaming of:

What I Want:

  • Universal app configuration sync (not just installation)
  • App-specific settings backup (automated for all apps)
  • License management automation (securely syncing paid app licenses)
  • Plugin/extension synchronization (VS Code extensions, browser extensions)

What’s On The Horizon:

  • Container-based app distribution (everything as containers)

Tips for Homebrew Mastery

Start Your Homebrew Journey:

  1. Audit your current apps: ls /Applications and see what’s available in Homebrew
  2. Create your first Brewfile: Start small with essential tools
  3. Use brew search: brew search <app-name> before downloading anything
  4. Set up automatic updates: Integrate with your dotfile management
  5. Join the community: Follow Homebrew taps for specialized software

Pro Tips:

# See what's installed
brew list

# See what's outdated
brew outdated

# Generate Brewfile from current installation
brew bundle dump

# Install everything from Brewfile
brew bundle install

# Remove packages not in Brewfile
brew bundle cleanup

Conclusion: 80% Perfect is Pretty Great

While I haven’t achieved complete app sync nirvana, the Homebrew-first approach combined with Chezmoi has transformed my development setup process. What used to take a full day of clicking through websites and installers now takes about 30 minutes—most of which is just waiting for downloads.

The reality is that those manual installs I still need to do are mostly edge cases: enterprise software, creative tools with complex licensing, or specialized apps. For 80% of my software stack, I have achieved the dream of declarative, version-controlled, automatically synchronized installation.

And honestly? 80% perfect is pretty damn good.

The future will likely bring us even closer to that sync nirvana, but for now, I’m grateful for how far we’ve come. If you’re still manually downloading apps in 2024, give Homebrew a try. Your future self (and your next computer setup) will thank you.


Ready to start your Homebrew journey? Check out the official Homebrew documentation and see how it integrates with my Chezmoi workflow for complete environment management.

© Copyright 2025 Idlemind.dev. All rights reserved.