Skip to content

Commit

Permalink
Merge pull request NixOS#180570 from romildo/upd.nixos.qt5
Browse files Browse the repository at this point in the history
nixos/qt5: add kde platform theme
  • Loading branch information
romildo authored Jul 10, 2022
2 parents f14058f + 41dbc0b commit 7802f1b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nixos/modules/config/qt5.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ let
isQtStyle = cfg.platformTheme == "gtk2" && !(builtins.elem cfg.style ["adwaita" "adwaita-dark"]);
isQt5ct = cfg.platformTheme == "qt5ct";
isLxqt = cfg.platformTheme == "lxqt";
isKde = cfg.platformTheme == "kde";

packages = if isQGnome then [ pkgs.qgnomeplatform pkgs.adwaita-qt ]
else if isQtStyle then [ pkgs.libsForQt5.qtstyleplugins ]
else if isQt5ct then [ pkgs.libsForQt5.qt5ct ]
else if isLxqt then [ pkgs.lxqt.lxqt-qtplugin pkgs.lxqt.lxqt-config ]
else if isKde then [ pkgs.libsForQt5.plasma-integration pkgs.libsForQt5.systemsettings ]
else throw "`qt5.platformTheme` ${cfg.platformTheme} and `qt5.style` ${cfg.style} are not compatible.";

in
Expand All @@ -33,13 +35,15 @@ in
"gnome"
"lxqt"
"qt5ct"
"kde"
];
example = "gnome";
relatedPackages = [
"qgnomeplatform"
["libsForQt5" "qtstyleplugins"]
["libsForQt5" "qt5ct"]
["lxqt" "lxqt-qtplugin"]
["libsForQt5" "plasma-integration"]
];
description = ''
Selects the platform theme to use for Qt5 applications.</para>
Expand Down Expand Up @@ -71,6 +75,10 @@ in
application.
</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>kde</literal></term>
<listitem><para>Use Qt settings from Plasma.</para></listitem>
</varlistentry>
</variablelist>
'';
};
Expand Down Expand Up @@ -119,7 +127,7 @@ in

environment.variables.QT_QPA_PLATFORMTHEME = cfg.platformTheme;

environment.variables.QT_STYLE_OVERRIDE = mkIf (! (isQt5ct || isLxqt)) cfg.style;
environment.variables.QT_STYLE_OVERRIDE = mkIf (! (isQt5ct || isLxqt || isKde)) cfg.style;

environment.systemPackages = packages;

Expand Down

0 comments on commit 7802f1b

Please sign in to comment.