Thoughts on Chezmoi
- Related pages
I really like to keep my dotfiles up to date, and I’ve been doing so for many years. During the years I’ve progress on how I managed by dotfiles and system dependencies. I went from manually copying the files to Ansible, then Python Fabric, then GNU Stow to manually managing with bash scripts and manual symlinks. Some of these tools were OK, some were more complex than the others. As my dotfiles started to grow, and as I started using multiple operating systems in my workflow, I needed something better to handle different systems.
The problem with some configuration files is that there is no scripting or conditions that you can make to support different systems, i.e. different binary paths or even different binary names. Then someday on IRC someone mentioned Chezmoi.
Chezmoi had exactly what I needed, templates, a command line interface to manage my files and integration with password managers. Now I just needed to update all my configuration files to adapt Chezmoi. I was already used to process of migration as I’ve done many times before. Why not another one?
As my dotfiles started to grow, the more I could take advantage of what Chezmoi
had to offer. For example, I can have multiple profiles by taking advantage of
the template system. In my chezmoi.yaml, I created different profiles and
based on that, I can chezmoiignore files based on these conditions. This
allows me to install a lightweight version of my dotfiles on a remote server.
Chezmoi can also help increase performance in zsh or bash configurations,
where one can use templates to manage different operating system requirements
and include them into the main configuration depending which system it is.