Installing Gnome changes color scheme for Hyprland

Hi, I am primary using Hyprland as desktop environment. There I have this:

  dconf.settings = {
    "org/gnome/desktop/interface" = {
      color-scheme = "prefer-dark";

This ensures that applications like nautilus that I use for file management, firefox and all others primary display with dark theme and it is working fine. Today I installed Gnome desktop with

services.xserver.desktopManager.gnome.enable = true;

all fine, but when I now login to Hyprland session, dolphin, firefox and others have light theme. When I login to Gnome and go to settings, dark theme is selected. What is changing that in hyprland and what can I do to have dark theme in Hyprland back? Thanks

Maybe ADW_DISABLE_PORTAL=1 (I’m just guessing it)?

I think I have found the reason. I have now this configuration:

  # Gnome
  services.xserver.desktopManager.gnome.enable = true;

  xdg.portal = {
    enable = true;
    #extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-hyprland ];
    extraPortals = [ pkgs.xdg-desktop-portal-hyprland ];

I had to remove xdg-desktop-portal-gtk because it is already part of Gnome and rebuild is returning me an error that xdg-desktop-portal-gtk in store already exists. But now when I login into the Hyprland session, xdg-desktop-portal-gtk is probably missing or is somehow broken and I dont have any idea how to solve it. Any help please?

EDIT: Confirmed, when I change to Mate for example that does not have xdg-desktop-portal-gtk dependency with this:

  services.xserver.desktopManager.mate.enable = true;

  xdg.portal = {
    enable = true;
    extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-hyprland ];

I have dark theme correctly working again in Hyprland

Hmm, maybe the x-d-p-hyprland does not implement settings portal, so it falls back to x-d-p-gtk, which, when installed through GNOME module, does not implement the settings portal either, because it is already provided by x-d-p-gnome:

You can try hacking around it by force-overriding the definition:

  extraPortals = lib.mkForce [
    pkgs.xdg-desktop-portal-gtk # For both
    pkgs.xdg-desktop-portal-hyprland # For Hyprland
    pkgs.xdg-desktop-portal-gnome # For GNOME

But we can probably drop the buildPortalsInGnome argument and always build all portals, now that xdg-desktop-portal supports configuring which implementation to use for each portal.

You my friend are the absolute hero. Works like a charm.