Architecture
Configuration Management Strategy
Overview
This document defines the configuration management approach for this development environment, consolidating multiple systems into a clear hierarchy.
Configuration Systems
Primary: Chezmoi
Role: Source of truth for all managed dotfiles Location: ~/.dotfiles/ (chezmoi source directory) Managed Files: 209 files/directories
Chezmoi handles:
- Shell configurations (.bashrc, .zshrc, .profile, .zshenv, .zprofile)
- Editor configs (.vimrc, nvim, VS Code settings)
- Tool configs (.gitconfig, .npmrc, .noderc, etc.)
- Application configs (~/.config/*)
- SSH configuration (~/.ssh/config, config.d/)
Tertiary: Runtime/Application Data
Role: Auto-generated, not version controlled Examples:
~/.cache/- Application caches~/.local/share/- Application data~/.cargo/,~/.rustup/- Language toolchains~/.npm/,~/.node_modules/- Node.js packages
Decision Matrix
| Configuration Type | Manager | Reason |
|---|---|---|
| Shell dotfiles | Chezmoi | Templated, machine-specific |
| Editor configs | Chezmoi | Consistent across machines |
| Git config | Chezmoi | Templated (email, signing key) |
| SSH config | Chezmoi | Structured with config.d/ |
| Euxis framework | Git (separate) | Independent lifecycle |
| Language runtimes | mise | Version management |
| System packages | apt/snap | OS-level |
| Application data | None | Auto-generated |
Chezmoi Configuration
Data Variables (.chezmoidata.toml)
profile = "laptop" # Machine profile
theme = "tokyonight-night" # Color scheme
terminal_font_family = "JetBrains Mono"
terminal_font_size = 12
[features]
zsh = true # Enable zsh configs
nvim = true # Enable neovim configs
tmux = true # Enable tmux configs
gui = true # Enable GUI app configs
secrets = true # Enable secret management
Template Patterns
Files ending in .tmpl are processed with Go templates:
dot_gitconfig.tmpl- Injects name, email, signing keymodify_private_dot_npmrc- Injects registry tokens and keeps the auth linesnpm loginwritesdot_noderc.tmpl- Injects Node.js settings
Ignored Patterns (.chezmoiignore.tmpl)
Machine-specific exclusions based on profile and features.
Workflow
Adding New Configuration
- Check if managed:
chezmoi managed | grep <file> - If not managed:
chezmoi add <file> - If templating needed: Rename to
.tmpl, add template logic - Apply changes:
chezmoi apply
Updating Configuration
- Edit source:
chezmoi edit <file>or edit in~/.dotfiles/ - Preview changes:
chezmoi diff - Apply:
chezmoi apply - Commit:
cd ~/.dotfiles && git add -A && git commit
Syncing Across Machines
# On new machine
# On existing machine
Anti-Patterns to Avoid
- Manual edits to managed files - Always edit via chezmoi or re-add after manual changes
- Duplicate configs - Don't maintain parallel configs outside chezmoi
- Hardcoded machine-specific values - Use templates and data variables
- Version controlling runtime data - Keep ~/.cache, ~/.local/share out of version control
File Ownership
| Path | Owner | Notes |
|---|---|---|
~/.dotfiles/ | chezmoi | Source of truth |
~/.* (dotfiles) | chezmoi-applied | Don't edit directly |
~/.config/* | Mixed | Check chezmoi managed |
~/.local/ | chezmoi (bin) + runtime | Partial management |
Maintenance Schedule
- Weekly:
chezmoi updateto sync remote changes - Monthly: Review
chezmoi unmanagedfor new configs to add - Quarterly: Audit
.chezmoiignorepatterns