Multi-machine dotfiles: macOS, Ubuntu VPS, Raspberry Pi, Android (Termux).
# Install chezmoi + apply dotfiles in one command
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply YOUR_GITHUB_USERNAMEpkg install chezmoi git zsh
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply YOUR_GITHUB_USERNAME
chsh -s zsh.chezmoi.toml.tmpl → config (auto-detects OS, prompts email)
dot_zshrc.tmpl → ~/.zshrc (templated per OS)
dot_p10k.zsh → ~/.p10k.zsh (powerlevel10k config)
.chezmoiignore → skip files per OS
run_once_install-zsh-plugins.sh → auto-clones zsh plugins
chezmoi edit ~/.zshrc # edit source, not target
chezmoi diff # see pending changes
chezmoi apply # apply changes
chezmoi cd # cd into source dir (for git commit/push)chezmoi edit ~/.zshrc- Wrap in template conditional:
{{- if eq .chezmoi.os "darwin" }} # macOS only stuff {{- end }} chezmoi apply && chezmoi cd && git add -A && git commit -m "add tool" && git push
Put machine-specific config that you don't want in chezmoi into ~/.zshrc.local.
This file is sourced at the end of .zshrc and is NOT managed by chezmoi.