This repository manages dotfiles using chezmoi.
- Install chezmoi:
# macOS (Homebrew)
brew install chezmoi- Initialize this repository as the source directory:
chezmoi init --source ~/workspace/github.com/Cain96/dotfiles- Apply the configuration files:
chezmoi applyIf chezmoi is already installed:
chezmoi init --source ~/workspace/github.com/Cain96/dotfiles
chezmoi applyTo edit files managed by chezmoi:
chezmoi edit <file-path>Examples:
chezmoi edit ~/.zshrc
chezmoi edit ~/.config/nvim/init.luaTo add a new dotfile under chezmoi management:
chezmoi add <file-path>Example:
chezmoi add ~/.bashrcTo apply changes from the repository to your home directory:
chezmoi applyTo check the difference between your home directory and the source directory:
chezmoi diffThis repository follows chezmoi's standard naming conventions:
dot_*→ Files placed at~/*dot_*/→ Directories placed at~/*/run_once_*.sh.tmpl→ Scripts executed once duringchezmoi apply
Examples:
dot_zshrc→~/.zshrcdot_config/nvim/init.lua→~/.config/nvim/init.luadot_Brewfile→~/.Brewfile
The repository includes run-once scripts that are executed automatically during chezmoi apply:
run_once_001_setup-brew.sh.tmpl- Sets up and updates Homebrew (macOS only)run_once_002_install-brewfile.sh.tmpl- Installs packages from Brewfile (macOS only)run_once_003_install-languages.sh.tmpl- Installs programming languages and tools from~/.config/mise/config.tomlusing mise, and sets up safe-chain (macOS only)run_once_004_install-tools.sh.tmpl- Installs additional tools (confirm-pam, similarity-ts, git-sequential-stage) using cargo and go (macOS only)run_once_005_mac-settings.sh.tmpl- Configures macOS system settings (Finder extensions, path bar, status bar, screenshot naming) (macOS only)
These scripts run only once per machine and are macOS-specific.