This repository contains my personal dotfiles and configuration files, managed using Chezmoi, a tool for managing dotfiles across multiple machines.
- Shell configurations for zsh and fish
- Terminal setups (kitty, wezterm, ghostty)
- Editor configs (nvim)
- System tools (tmux, starship, etc.)
- Platform-specific setups for macOS and Linux
To use this repo on a new machine:
-
Install Chezmoi: Follow the official installation guide. For example, on macOS with Homebrew:
brew install chezmoi
-
Initialize Chezmoi: Use Chezmoi's native initialization flow:
chezmoi init --apply https://github.com/chianyungcode/dotfiles.git
Initialization asks for the machine role first.
- A
serverautomatically uses the local-onlyserver-minimalidentity, disables personal and graphical features, uses no secrets provider, and disables Age-encrypted files. Only development and homelab capabilities are prompted. - A
workstationprompts for its identity profile, capabilities, secrets provider, and Age-encrypted files.
The server path does not require
opor an Age identity. See Server Initialization for migration, exceptional overrides, and emergency local commits. - A
-
Apply Configurations: Run
chezmoi applyto apply all dotfiles to your home directory. -
Inspect Configuration:
chezmoi data chezmoi execute-template '{{ .identity | toJson }}' chezmoi execute-template '{{ .features | toJson }}' chezmoi execute-template '{{ .secrets | toJson }}' chezmoi execute-template '{{ .xdg | toJson }}' chezmoi apply --dry-run --verbose
-
Post-Installation:
- Install optional packages through the capability selections made during initialization.
- Workstations can change their secrets provider or Age-encrypted file policy by updating Chezmoi's configuration and applying again. Server reinitialization restores both settings to their secretless defaults.
- Workstations enable the configured
delta/difftexperience; server roles use built-in Git and Jujutsu diffs.
Run the local render matrix before applying changes to a real home directory:
./tests/chezmoi-render-config.shThe matrix renders secretless server and development data, a graphical
workstation, CI-derived ignores, and custom XDG paths into temporary
destinations. It does not install packages or require op credentials.
- Edit Files: Modify files in
~/.local/share/chezmoi/and runchezmoi applyto update symlinks. - Add New Files: Use
chezmoi add ~/.somefileto track new dotfiles. - Templates: Files ending in
.tmpluse Go templates for dynamic content (e.g., paths, secrets). - Platform-Specific: Check
.chezmoidata/for shared package and account data; OS detection uses Chezmoi's built-in.chezmoidata.
Chezmoi automation uses three layers:
.chezmoidatadeclares system, language, and standalone packages..chezmoitemplates/scriptscontains focused platform implementation fragments..chezmoiscriptscontains eight ordered execution phases from bootstrap through monthly maintenance.
Run chezmoi apply --dry-run --verbose to inspect rendered phases before the
first apply on a machine.
Fork the repo, make changes, and submit a pull request. Ensure compatibility across platforms.
For more details, see the docs/ directory, including macOS-specific
setup in readme-macos.md.
MIT License - see LICENSE file if present.