I know hyprland works great with home-manager if that kind of thing is up your alley
NixOS
NixOS is a Linux distribution built on top of the Nix package manager. Its declarative configuration allows reliable system upgrades via several official channels of stability and size.
This community discusses NixOS, Nix, and everything related.
I enable the desktop environment through the normal nixos module and it works great, but I use KDE and it doesn't have declarative configuration support through nixos so all the dotfiles are managed like normal. I've heard GNOME has better support if you want to set the configs through NixOS or Home-Manager whatever, but I haven't used it so idk.
I asked this question on Mastodon and got some helpful answers. I haven't had the time to try anything yet, but here are some links. KDE: https://github.com/pjones/plasma-manager Gnome: https://hoverbear.org/blog/declarative-gnome-configuration-in-nixos/ Xfce may be similar to the Gnome article but using xfconf and xfconf-query to get the settings to apply. Again I haven't tried any of these suggestions. This is a summary of the info I got elsewhere.