My dotfiles, managed with chezmoi.
To install these dotfiles on a new machine, run:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/drod3763/dotfiles/main/install.sh)"This will:
- Bootstrap base prerequisites (Xcode CLI tools/Homebrew as needed).
- Install
chezmoilocally if missing. - Initialize with this repository and apply configuration.
- During
chezmoi apply, run a pre-read hook that installs1password-cliandagewhen needed.
If you prefer to clone the repository first or need custom options:
git clone git@github.com:drod3763/dotfiles.git ~/.local/share/chezmoi
cd ~/.local/share/chezmoi
./install.shchezmoi diff- preview changes without applying themchezmoi apply --dry-run- simulate an apply run safelychezmoi apply- copy rendered files into the home directorychezmoi status- show managed files that differ from source statechezmoi edit ~/.zshrc- edit the source template for a managed destination filechezmoi execute-template < home/.chezmoitemplates/functions.tmpl- inspect rendered template outputchezmoi data- inspect the full template data context used during rendering
By default, the installation script runs quietly. To see detailed output from chezmoi operations:
Via script:
./install.sh --verbose
# or
./install.sh -vVia curl:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/drod3763/dotfiles/main/install.sh)" -- --verbose
# or set the environment variable
VERBOSE=1 bash -c "$(curl -fsSL https://raw.githubusercontent.com/drod3763/dotfiles/main/install.sh)"The installation script respects the following environment variables:
| Variable | Description | Default |
|---|---|---|
VERBOSE |
Set to 1 or true to enable verbose output from chezmoi |
false |
OP_SERVICE_ACCOUNT_TOKEN |
Optional 1Password Service Account token for headless/service-mode secret injection | (Interactive prompt during apply hook) |
- Cross-Platform Structure: OS-specific hooks and templates live under
home/.chezmoiscripts/{macOS,windows,linux}. - macOS Configuration: Automates system preferences (Finder, Dock, Safari, etc.).
- Package Management: Installs Homebrew packages, casks, and Mac App Store apps (via
mas). - Sleep Prevention: Uses
caffeinateduring installation to prevent sleep interruptions. - Progress Feedback: Provides clear status updates during long-running tasks.
- Structured Template Data: Uses domain-scoped
chezmoidatafiles underhome/.chezmoidata/for reusable catalogs (package catalog, shell manifests, ignore lists, MCP, 1Password mappings). - Package-Aware Config: Derives app config/env inclusion from the package catalog so machine profiles only materialize relevant app settings.
This repo includes multi-language formatting via treefmt configuration at home/treefmt.toml.
- Run all formatters:
mise exec -- treefmt --config-file home/treefmt.toml - Format specific files:
mise exec -- treefmt --config-file home/treefmt.toml <path>...
Configured formatters include:
nixpkgs-fmtfor Nixtaplofor TOML (includinghome/private_dot_config/git/config.tmplvia a dedicated formatter rule)shfmtfor shell scriptsprettier(viabunx) for JSON/YAML/Markdownprettier-plugin-go-template(viabunx) for*.tmplGo templates (when the plugin is resolvable in the active environment)
Shell script logic and rendered-template checks use bats-core with CLI mocks.
- Run test suite:
scripts/run_bats_tests.sh - Test files:
tests/bats/**/*.bats - Rendered shell checks:
tests/bats/scripts/check_rendered_shell_templates.bats
Proposal-driven changes live under openspec/, with repo-specific helper workflows under .agent/workflows/.
- List active changes:
mise exec -- openspec list - List current specs:
mise exec -- openspec spec list --long - Validate a change or spec:
mise exec -- openspec validate <item> --strict
Shared template data is split by domain in home/.chezmoidata/*.toml.
Schema reference and onboarding guide:
-
docs/chezmoidata.md -
shell_manifest/apps/*.toml- one file per cask package catalog entry (plus app-owned shell entries) -
shell_manifest/mas/*.toml- one file per Mac App Store package catalog entry -
shell_manifest/taps/*.toml- one file per Homebrew tap package catalog entry -
shell_manifest/tool/*.toml- tool/formula package entries plus tool-owned shell entries -
shell_manifest/**/*.toml- split shell behavior manifest files (aliases, exports, functions, init) -
mcp.toml- shared MCP server definitions -
onepassword.toml- centralized item/vault mappings and field identifiers
Chezmoi source files in this repo are rendered and copied into your home directory.
home/dot_zshrc.tmplbecomes~/.zshrchome/dot_bashrc.tmplbecomes~/.bashrchome/private_dot_config/...becomes~/.config/...home/private_Library/...becomes~/Library/...home/.chezmoiscripts/...are lifecycle scripts executed by chezmoi during apply, not copied as normal config files
When tracing behavior, check both the source path in this repo and the destination path under $HOME.
The shell manifest under home/.chezmoidata/shell_manifest/ is the primary source of truth for shell behavior in this repo.
- Shell functions, aliases, exports, and init snippets are generally defined in
shell_manifest/**/*.toml, not directly inzshrcor bash rc files. home/.chezmoitemplates/shell_manifest_renderer.tmplmerges active manifest entries based on rules like shell, OS, installed tools, and personal/work context.home/.chezmoitemplates/{functions,aliases,exports,init}.tmplrender those merged entries into shell section files.home/private_dot_config/zsh/dot_zshrc.tmplandhome/dot_bashrc.tmplprimarily source those rendered sections.- Tool-owned shell functions are commonly defined in
home/.chezmoidata/shell_manifest/tool/*.toml.
If you need to trace a shell function or alias, start with home/.chezmoidata/shell_manifest/**/*.toml, then follow the render path through shell_manifest_renderer.tmpl and the section templates.
Templates avoid hardcoded secrets and use centralized mappings from home/.chezmoidata/onepassword.toml.
- Vault aliases are used (
dev,work) instead of raw vault IDs in templates. - Helpers in
home/.chezmoitemplates/resolve values by stable field id/label and URL label. - On macOS with 1Password app installed, chezmoi uses
onepassword.mode = "account"; otherwise it falls back to"service"mode. - Service account token (
OP_SERVICE_ACCOUNT_TOKEN) is optional and primarily for headless/CI/service-mode workflows. - Age identities are bootstrapped from
home/.chezmoidata/onepassword.toml([[onepassword.age_identities]]) into~/.config/chezmoi/age-identities/before apply.
Package behavior is defined by package catalog entries embedded across home/.chezmoidata/shell_manifest/{apps,mas,taps,tool}/*.toml and shell entries across home/.chezmoidata/shell_manifest/**/*.toml.
- Each package declares lifecycle metadata (
os,type,target_class) and install identifiers (brew_formula_name,brew_cask_name,mas_app_id,linux_pkg_name). - Config path inclusion/exclusion is derived from package
config_file_locationsviahome/.chezmoiignore. - Shell aliases/exports/functions/init are declared via shell manifest entries in
home/.chezmoidata/shell_manifest/**/*.toml. - Active package sets are computed by
home/.chezmoitemplates/package_catalog_resolver.tmpland consumed by install/config templates and ignore resolution.
This supports a package-centric lifecycle with shell behavior defined in declarative manifest data.