I use home-manager in a NixOS configuration. When I do nixos-rebuild switch --flake, I frequently get these:
Existing file '/home/icyrockcom/.config/gtk-4.0/gtk.css' is in the way of '/nix/store/rxcgimxlbcn1ngyl86v1ylsyzmpd21fk-home-manager-files/.config/gtk-4.0/gtk.css'
Doing rm /home/icyrockcom/.config/gtk-4.0/gtk.css and re-doing nixos-rebuild switch --flake fixes.
Is there a way to tell home-manager to overwrite a certain file (or anything under a certain folder) always?
Ah, got it, that’s the equivalent of the suggested -b command line option.
There’s no way to apply this on a per-file basis? I.e. if there are two files that home-manager manages, I may care about one file not being changed (and the rebuild failing in this case) and not care about the other file (and the rebuild making a backup and putting the new file there instead).
For example, I may care about my ~/.bashrc and not want that silently backed up + overwritten if it gets changed for whatever reason. On the other hand, I don’t really care about the above ~/.config/gtk-4.0/gtk.css.