Reference
Reference: Template Variables
Every variable available to chezmoi templates (.tmpl files).
From .chezmoidata.toml
Flat top-level keys:
| Variable | Type | Example |
|---|---|---|
.dotfiles_version | string | "0.2.527" |
.theme | string | "tahoe-dark" |
.machine | string | "macbook-t2" |
.profile | string | "laptop" |
.default_shell | string | "fish" |
.terminal_font_family | string | "JetBrainsMono Nerd Font" |
.terminal_font_size | int | 12 |
.name | string | "Your Name" |
.email | string | "[email protected]" |
From .chezmoidata/themes.toml
// "dark" or "light"
// "tahoe"
// 4 (integer)
// "#121430"
// "#d4d8ec"
.. // ANSI 0-15
// "#3951b1"
// "#ffffff"
// "catppuccin"
From .chezmoidata/hardware.toml
// 2.0
// "qwerty"
// "left-cmd-control"
// "laptop"
// "aerospace"
// bool
From Feature Flags
# Dank Material Shell-specific config
# Niri WM config
Built-in Chezmoi Variables
// "darwin" | "linux" | "windows"
// "amd64" | "arm64"
// "Darwin" | "Linux"
// "darwin24" etc
// host machine hostname
// current user
// $HOME
// ~/.dotfiles
// git working tree root
// chezmoi binary path
// Linux /etc/os-release data
Built-in Chezmoi Functions
// macOS only
// returns path or empty
Helper Templates (in .chezmoitemplates/)
Reusable partials included via:
Available partials:
paths/00-default.paths.sh— canonical PATH constructionpaths/05-pipx.paths.sh— pipx + ~/.local/binpaths/99-custom.paths.sh— user-appended pathsaliases/*.aliases.sh— per-domain alias setsfunctions/*.sh— reusable shell functions
Example: Using Theme in Ghostty Config
font-family = "{{ .terminal_font_family }}"
font-size =
background =
foreground =
cursor-color =
palette = 0=
palette = 1=
palette = 2=
# ... through 15
macos-titlebar-style = transparent
Example: Platform × Preset
# macOS AeroSpace config
include =
# Linux Niri config
include =
# DPI-aware sizing
font-size =
Template Testing
Render a template without applying:
Or test an expression:
# darwin
# #121430
Validation in CI
Every push to main runs:
If any template fails to render, the build breaks before merge.