Skip to main content

Chezmoi

This setup uses chezmoi to keep a macOS development environment reproducible.

If you have not used chezmoi before, start at Getting Started.

Source Layout

If you are reading the source on GitHub, you can treat home/ as "what gets installed".

Render Model

Prompt definitions and computed values are defined in:

This is where machine-specific values are decided (for example isWork, emails, homebrewPrefix, and cache TTL values).

If something renders differently than expected, start by inspecting this file.

Hook Pipeline (High Signal)

The first-run and converge flow is driven by ordered scripts in home/.chezmoiscripts/:

OrderHookPurpose
00run_once_before_00-install-xcode.shXcode CLT
01run_once_after_01-install-brew.shHomebrew install
02run_once_after_02-install-fish.shFish install + login shell
03run_onchange_after_03-install-brew-packages.fish.tmplBrew bundle
04run_onchange_after_04-update-fish-packages.fish.tmplFish plugins
05run_onchange_after_05-*Package, OS, and integration scripts
06run_onchange_after_06-update-uv-tools.sh.tmpluv global tools

This is the first place to look when chezmoi apply fails.

Core Workflows

Safe apply loop

chezmoi diff
chezmoi apply

Use chezmoi diff before apply whenever you changed templates or prompt data.

Pull remote changes safely

chezmoi update --apply=false
chezmoi diff
chezmoi apply

Debug a failing hook

  1. Re-run and capture the failing script path:
chezmoi apply
  1. If it is a template hook, render it directly:
chezmoi execute-template < home/.chezmoiscripts/<script>.tmpl
  1. Run the generated command or script directly to isolate dependency issues.

Verification And Troubleshooting

Useful checks:

chezmoi doctor
chezmoi status
chezmoi diff

Externals can be refreshed with:

chezmoi apply -R always

If a script fails with command not found, check whether its prerequisite hook (usually Homebrew/mise) ran successfully.