Try nix to manage dotfiles
As I see you way to manage dotfiles, home-manager may be interested for you
Maybe as far as NixOS as base system
Things to check:
-
NixOS https://nixos.org -
interesting dotfiles for all system https://sr.ht/~hutzdog/Dotfiles/
-
-
home-manager https://github.com/nix-community/home-manager