1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

qt: fix basic usage when just qt.enable = true is set

This commit is contained in:
Thiago Kenji Okada 2023-11-19 12:35:28 +00:00
parent 9a4725afa6
commit fff5204e5d
3 changed files with 23 additions and 5 deletions

View file

@ -159,8 +159,10 @@ in {
# Necessary because home.sessionVariables doesn't support mkIf
envVars = lib.filterAttrs (n: v: v != null) {
QT_QPA_PLATFORMTHEME =
styleNames.${cfg.platformTheme} or cfg.platformTheme;
QT_QPA_PLATFORMTHEME = if (cfg.platformTheme != null) then
styleNames.${cfg.platformTheme} or cfg.platformTheme
else
null;
QT_STYLE_OVERRIDE = cfg.style.name;
};
@ -206,9 +208,10 @@ in {
# Apply theming also to apps started by systemd.
systemd.user.sessionVariables = envVars // envVarsExtra;
home.packages = (platformPackages.${cfg.platformTheme} or [ ])
++ lib.optionals (cfg.style.package != null)
(lib.toList cfg.style.package);
home.packages = (lib.optionals (cfg.platformTheme != null)
platformPackages.${cfg.platformTheme})
++ (lib.optionals (cfg.style.package != null)
(lib.toList cfg.style.package));
xsession.importedVariables = [ "QT_PLUGIN_PATH" "QML2_IMPORT_PATH" ]
++ lib.optionals (cfg.platformTheme != null) [ "QT_QPA_PLATFORMTHEME" ]