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 prerequisites: Make sure
curlandgitare available. Their availability depends on the distribution and installation image; on Ubuntu you can install them with:sudo apt update sudo apt install -y curl git
-
Install and initialize Chezmoi: Run:
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply chianyungcodeThis installs Chezmoi if needed, initializes the repository, and applies the configuration. 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
-
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.