From 8d5cd725ad591890c0cd804bf68cc842b8afca51 Mon Sep 17 00:00:00 2001 From: ArchercatNEO <108980279+ArchercatNEO@users.noreply.github.com> Date: Thu, 17 Apr 2025 18:21:11 +0100 Subject: [PATCH] qt: fix kvantum breaking plasma6 (#1128) Reviewed-by: Kilian Mio <86004375+Mikilio@users.noreply.github.com> --- modules/qt/nixos.nix | 56 +++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/modules/qt/nixos.nix b/modules/qt/nixos.nix index f05456b6..55fe5afa 100644 --- a/modules/qt/nixos.nix +++ b/modules/qt/nixos.nix @@ -30,37 +30,29 @@ in config = let - broken = config.services.desktopManager.plasma6.enable; - warning = { - warnings = [ - "stylix: qt: Plasma6 is currently unsupported: https://github.com/nix-community/home-manager/issues/5098" - ]; - }; - default = lib.mkIf (config.stylix.enable && config.stylix.targets.qt.enable) { - - stylix.targets.qt.platform = - with config.services.xserver.desktopManager; - if gnome.enable && !(plasma5.enable || lxqt.enable) then - "gnome" - else if plasma5.enable && !(gnome.enable || lxqt.enable) then - "kde" - else if lxqt.enable && !(gnome.enable || plasma5.enable) then - "lxqt" - else - "qtct"; - qt = { - enable = true; - style = recommendedStyle."${config.qt.platformTheme}" or null; - platformTheme = - if config.stylix.targets.qt.platform == "qtct" then - "qt5ct" - else - config.stylix.targets.qt.platform; - }; - }; + inherit (config.services.xserver.desktopManager) gnome plasma5 lxqt; + inherit (config.services.desktopManager) plasma6; in - lib.mkMerge [ - (lib.mkIf broken warning) - (lib.mkIf (!broken) default) - ]; + lib.mkIf (config.stylix.enable && config.stylix.targets.qt.enable) { + stylix.targets.qt.platform = + if gnome.enable && !(plasma5.enable || plasma6.enable || lxqt.enable) then + "gnome" + else if plasma5.enable && !(gnome.enable || plasma6.enable || lxqt.enable) then + "kde" + else if plasma6.enable && !(gnome.enable || plasma5.enable || lxqt.enable) then + "kde6" + else if lxqt.enable && !(gnome.enable || plasma5.enable || plasma6.enable) then + "lxqt" + else + "qtct"; + qt = { + enable = true; + style = recommendedStyle."${config.qt.platformTheme}" or null; + platformTheme = + if config.stylix.targets.qt.platform == "qtct" then + "qt5ct" + else + config.stylix.targets.qt.platform; + }; + }; }