Incoming long post, please consider reading at least the following TL;DR before commenting.
TL;DR: Interested in finding the means to manage my dotfiles in a declarative, ‘immutable’/read-only way and with automatic sync across two devices (and a fleet of container environments). The method shouldn’t require the management of my packages.
First of all, I’m still relatively new to managing dotfiles. So far, git
has been doing fine, but time has come to upgrade.
Goals: As I’ve moved from a non-declarative way of administrating my system to one in which some elements are declarative, it just feels appropriate to apply a touch of ‘declarative-ness’ to managing dotfiles as well.
Furthermore, as I’ve been using image-based (‘immutable’) distros for some time already, I want to explore the possibilities of managing dotfiles within that ‘immutable’ paradigm.
Specifics of my usage: The primary desire is to have it working on two systems simultaneously. If possible, changes to one should ‘automatically’ apply to the other and vice versa. Furthermore, the exact content of the managed dotfiles is not the same on both, so differentiation is a requirement. My container workloads can be handled by the likes of chezmoi
and or yadm
. Nonetheless, being able to manage their dotfiles as well is definitely a plus.
Options that I’ve explored and associated (potential) challenges:
-
Nix’ Home Manager. From what I’ve gathered, this offers by default most of what I desire. However, I’m interested to know what the limitations are of managing dotfiles only as I’m not interested in installing any Nix packages. So it would have to manage the dotfiles of packages/software/whatever that weren’t installed with Nix.
Furthermore, to my knowledge, Nix doesn’t play nice with container environments; while this is not a hard requirement, I hope to be wrong on this.EDIT: Could not find sources to back this up. -
Guix with
guix home
. Unless I’m wrong, this is Guix’ Home Manager. So it’s met with similar challenges like those found in the previous paragraph. Furthermore, I’m interested to know if either of the two fares better than the other for my use case. -
While
chezmoi
,yadm
and other known dotfiles managers technically offer a solution, their respective solutions aren’t declarative or ‘immutable’ by default. While I’m sure someone might be able to hack one of them to better fit my needs, I’m not sure if I’m personally willing to commit to that. EDIT: Apparentlychezmoi
is declarative. I currently wonder which other dotfiles managers I might have mistakenly dismissed for disregarding the possibility that they might be declarative. Furthermore,chezmoi
seems to allow declarative control on the read-write permissions of files, which might allow restricting files to just read-only. -
Old, trusty
git
. Probably furthest removed from what I desire by default, but perhaps someone knows how to make it fit regardless.
Please feel free to inform me if I’ve missed anything! Thanks in regards 🙂 !
EDIT: So far chezmoi
has surprised me pleasantly with the possibilities it offers. But before committing, I would like to have some input from our residents that swear by Nix/Guix.