Moving from Gnu stow to Chezmoi
Current way of managing dotfiles (GNU stow) and limitations
I’ve been managing my dotfiles via git and gnu-stow for a while. GNU stow is just a symlinks manager that ensures that the files in your dotfiles location, are symlink-ed to the directories where they are supposed to be found.
This makes sense if the operating environment are similar. But what if you are moving from specific linux distros to mac to windows?
Another issue was that I was using several plugin’s in neovim that are configured to use specifc utilities for example ripgrep and rust. These packages need to be installed individually or I would face errors when porting over.
These annoyances are tolerable if you are doing the setup once in a while on a new computer. But I wanted a way to get the setup going on containers and on containerized workflows.
Enter chezmoi
Chezmoi takes a different approach, and solves the following issues.
Managing directory mappings
Instead of symlinks, chezmoi re-generates the files being managed by running them through the templates that you configure. It also has a git like repository manager that can tell when existing file have changes and need to be re-applied.
This means you can store the files exactly where you need them to be and configure the templates to understand where the files need to go. This also means that you dont have to manage a .stow-local-ignore file anymore.
Managing installations and plugins
The entire management of where the dotfiles go and what gets installed can now be configured via tmpl or template files which you can curate.
The fact that they can be generated into common bash scripts also makes the installation so much easier.
Current workflow
Useful links
- natelandau: blog on managing dotfiles blog
- twpayne: creator of chezmoi chezmoi repo, dotfiles
Leave a comment