anchor.diff:          </varlistentry>
         '';
   
  +      assertions = [
  +        {
  +          assertion = cfg.font == null && cfg.iconTheme == null;
  +          message = "`qt5.font` and `qt5.iconTheme` are only supported by kde platform.";
  +        }
  +      ];
         environment.variables.QT_QPA_PLATFORMTHEME = "qgnomeplatform";
         # TODO: make this optional once https://github.com/NixOS/nixpkgs/issues/54150 is fixed
         # qgnomeplatform reads theme and other settings from dconf db
         environment.variables.QT_STYLE_OVERRIDE = cfg.style.name;
         environment.variables.XDG_DATA_DIRS = [ "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}" ];
         environment.systemPackages = [ pkgs.qgnomeplatform ];
  +    };
  +    gtk3 = {
  +      description = ''
  +        <varlistentry>
  +          <term><literal>gtk3</literal></term>
  +          <listitem><para>Use GNOME theme with
  +            <link xlink:href="https://code.qt.io/cgit/qt/qtbase.git/tree/src/plugins/platformthemes/gtk3">gtk3</link>
  +          </para></listitem>
  +        </varlistentry>
  +      '';
  +
  +      assertions = [
  +        {
  +          assertion = cfg.style != null;
  +          message = "`qt5.platformTheme` gtk3 requires `qt5.style` to be set.";
  +        }
  +        {
  +          assertion = cfg.font == null && cfg.iconTheme == null;
  +          message = "`qt5.font` and `qt5.iconTheme` are only supported by kde platform.";
  +        }
  +      ];
  +      environment.variables.QT_QPA_PLATFORMTHEME = "gtk3";
  +      environment.variables.QT_STYLE_OVERRIDE = cfg.style.name;
  +    };
  +    kde = {
  +      description = ''
  +        <varlistentry>
  +          <term><literal>kde</literal></term>
  +          <listitem><para>Use Qt theme with
  +            <link xlink:href="https://code.qt.io/cgit/qt/qtbase.git/tree/src/platformsupport/themes/genericunix">qkdetheme</link>
  +          </para></listitem>
  +        </varlistentry>
  +      '';
  +
  +      environment.variables.XDG_CURRENT_DESKTOP = mkForce "KDE";
  +      environment.variables.KDE_SESSION_VERSION = "5";
  +      environment.etc."xdg/kdeglobals".text =
  +        toQtIni {
  +          General = general;
  +          Icons = icons;
  +        };
       };
     };
   in
  
positive.code:         '';
        };
  
        style = mkOption {
          type = types.nullOr themeType;
          default = null;
  
negative.code: 
      environment.variables = attrByPath [ cfg.platformTheme "environment" "variables" ] {} platforms;
  
      environment.etc = attrByPath [ cfg.platformTheme "environment" "etc" ] {} platforms;
  
      environment.systemPackages = attrByPath [ cfg.platformTheme "environment" "systemPackages" ] [] platforms
        ++ optionalPackage cfg.font
        ++ optionalPackage cfg.style
        ++ optionalPackage cfg.iconTheme;
  
    };
  
  