Chezmoi

Chez Moi dotFiles configuration manager & gitHub

DOcument: https://github.com/twpayne/chezmoi/tree/master/assets/chezmoi.io/docs https://github.com/twpayne/chezmoi/blob/master/assets/chezmoi.io/docs/quick-start.md

https://github.com/twpayne/chezmoi/discussions/1312 & https://github.com/twpayne/chezmoi/issues/3405

INstallation, Reddit, Biduman + dotFiles

~/.local/share/chezmoi houses the universal source of your dotfiles, which is shared and version-controlled across all your machines. ~/.config/chezmoi/chezmoi.toml stores machine-specific configurations and data that customize how chezmoi generates your dotfiles on a particular machine.

In chezmoi, ~/.local/share/chezmoi and ~/.config/chezmoi/chezmoi.toml serve distinct purposes in managing your dotfiles:

  1. ~/.local/share/chezmoi (Source Directory):
  • This directory (or your specified sourceDir) is where chezmoi stores the source state of your dotfiles. It is essentially a clone of your dotfiles Git repository.
  • It contains the files, directories, and symbolic links that chezmoi manages, representing the desired state of your home directory.
  • Files in this directory can be regular files or templates (e.g., dot_gitconfig.tmpl) that chezmoi processes to generate the final target files in your home directory.
  • The content of this directory is intended to be the same across all your machines, managed and synchronized via your version control system (e.g., Git).
  1. ~/.config/chezmoi/chezmoi.toml (Configuration File):
  • This file (or your specified configFile) contains machine-specific data and configurations for chezmoi itself.
  • It defines variables and settings that can vary between different machines where you use chezmoi.
  • This data is often used within templates stored in your source directory to customize the generated dotfiles for the specific machine. For example, you might define a different email address in chezmoi.toml for your work machine compared to your personal machine, and then use this variable in your dot_gitconfig.tmpl.
  • The configuration file is typically not managed by chezmoi itself in the same way as your dotfiles in the source directory. It’s meant to be local to each machine and can contain sensitive information or machine-specific settings.