1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

qt: fix issues introduced in previous merge

This commit is contained in:
Robert Helgesson 2023-11-21 08:38:09 +01:00
commit 9482610ac1
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
4 changed files with 43 additions and 5 deletions

View file

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

View file

@ -1,4 +1,6 @@
{ {
qt-basic = ./qt-basic.nix;
qt-platform-theme-gtk = ./qt-platform-theme-gtk.nix; qt-platform-theme-gtk = ./qt-platform-theme-gtk.nix;
qt-platform-theme-gtk3 = ./qt-platform-theme-gtk3.nix;
qt-platform-theme-gnome = ./qt-platform-theme-gnome.nix; qt-platform-theme-gnome = ./qt-platform-theme-gnome.nix;
} }

View file

@ -0,0 +1,14 @@
{ config, lib, pkgs, ... }:
{
config = {
qt.enable = true;
nmt.script = ''
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_PLUGIN_PATH'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QML2_IMPORT_PATH'
'';
};
}

View file

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
{
config = {
qt = {
enable = true;
platformTheme = "gtk3";
};
nmt.script = ''
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_QPA_PLATFORMTHEME="gtk3"'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QT_PLUGIN_PATH'
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
'QML2_IMPORT_PATH'
'';
};
}