Configuration file
chezmoi searches for its configuration file according to the XDG Base Directory
Specification
and supports JSON, JSONC,
TOML, and YAML. The
basename of the config file is chezmoi. If multiple configuration file formats
are present, chezmoi will report an error.
In most installations, the config file will be read from
$HOME/.config/chezmoi/chezmoi.$FORMAT
(%USERPROFILE%/.config/chezmoi/chezmoi.$FORMAT), where $FORMAT is one of
json, jsonc, toml, or yaml. The config file can be set explicitly with
the --config command line option. By default, the format is detected based on
the extension of the config file name, but can be overridden with the
--config-format command line option.
Examples
~/.config/chezmoi/chezmoi.json
{
"sourceDir": "/home/user/.dotfiles",
"git": {
"autoPush": true
}
}
~/.config/chezmoi/chezmoi.jsonc
{
// The chezmoi source files are stored here
"sourceDir": "/home/user/.dotfiles",
"git": {
"autoPush": true
}
}
~/.config/chezmoi/chezmoi.toml
sourceDir = "/home/user/.dotfiles"
[git]
autoPush = true
~/.config/chezmoi/chezmoi.yaml
sourceDir: /home/user/.dotfiles
git:
autoPush: true