diff --git a/nixos/modules/config/qt.nix b/nixos/modules/config/qt.nix index ee771698323e..d78d4f092b72 100644 --- a/nixos/modules/config/qt.nix +++ b/nixos/modules/config/qt.nix @@ -4,7 +4,6 @@ pkgs, ... }: - let cfg = config.qt; @@ -22,6 +21,11 @@ let libsForQt5.plasma-integration libsForQt5.systemsettings ]; + kde6 = [ + kdePackages.kio + kdePackages.plasma-integration + kdePackages.systemsettings + ]; lxqt = [ lxqt.lxqt-qtplugin lxqt.lxqt-config @@ -32,6 +36,11 @@ let ]; }; + # Maps style names to their QT_QPA_PLATFORMTHEME, if necessary. + styleNames = { + kde6 = "kde"; + }; + stylePackages = with pkgs; { bb10bright = [ libsForQt5.qtstyleplugins ]; bb10dark = [ libsForQt5.qtstyleplugins ]; @@ -61,7 +70,10 @@ let adwaita-qt6 ]; - breeze = [ libsForQt5.breeze-qt5 ]; + breeze = [ + libsForQt5.breeze-qt5 + kdePackages.breeze + ]; kvantum = [ libsForQt5.qtstyleplugin-kvantum @@ -115,6 +127,14 @@ in "libsForQt5" "systemsettings" ] + [ + "kdePackages" + "plasma-integration" + ] + [ + "kdePackages" + "systemsettings" + ] [ "lxqt" "lxqt-config" @@ -138,7 +158,8 @@ in The options are - `gnome`: Use GNOME theme with [qgnomeplatform](https://github.com/FedoraQt/QGnomePlatform) - `gtk2`: Use GTK theme with [qtstyleplugins](https://github.com/qt/qtstyleplugins) - - `kde`: Use Qt settings from Plasma. + - `kde`: Use Qt settings from Plasma 5. + - `kde6`: Use Qt settings from Plasma 6. - `lxqt`: Use LXQt style set using the [lxqt-config-appearance](https://github.com/lxqt/lxqt-config) application. - `qt5ct`: Use Qt style set using the [qt5ct](https://sourceforge.net/projects/qt5ct/) @@ -215,7 +236,9 @@ in ]; environment.variables = { - QT_QPA_PLATFORMTHEME = lib.mkIf (cfg.platformTheme != null) cfg.platformTheme; + QT_QPA_PLATFORMTHEME = + lib.mkIf (cfg.platformTheme != null) + styleNames.${cfg.platformTheme} or cfg.platformTheme; QT_STYLE_OVERRIDE = lib.mkIf (cfg.style != null) cfg.style; };