Which one should I choose? Is there any benefit of using home-manager instead of managing dotfiles how the developer intended them to be done or how Nix thinks they should be declared?
This is false dichotomy. The benefit of nix is closure. If you don’t think that’s a useful property (i.e. if git is on the path then my configuration file is correctly setup), then don’t use nix. Use whatever else you want. If you do think that’s a useful property and are willing to eat eval / activation to get it then use home-manager, or nix-maid, or hjem or whatever the community comes up with next. Developer intent isn’t really part of it, aside whether they respect configuration as read-only, and state as mutable.
Both I think have their place. I keep some dotfiles using stow to manage and others managed with home-manager. If you are frequently changing something (e.g. ricing initial configuration of a new tool), it can be easier and have a faster iteration time to just manage the dotfiles directly. Once something is stable, it’s nice to be able to move that config into home-manager, especially if there’s a module available.
You could create the symlinks with home-manager where required and keep the rest of the configs as part of the normal Nix configuration.
This way you don’t need an additional tool just for the symlinks.
Home manager contains its own symlink farm mechanism via the undocumented mkOutOfStoreSymlink function.
https://www.foodogsquared.one/posts/2023-03-24-managing-mutable-files-in-nixos/
So you can get the stow setup without requiring stow and still keeping home-manager for the module support.
dotfiles? hjem or nix-maid. home-manager is overkill, in my opinion. ![]()
…
though, extra options? home-manager (ditto) or hjem-rum.