mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 03:29:45 +01:00
qt: fix issues introduced in previous merge
This commit is contained in:
commit
9482610ac1
4 changed files with 43 additions and 5 deletions
|
@ -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} or [ ])
|
||||
++ (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" ]
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{
|
||||
qt-basic = ./qt-basic.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;
|
||||
}
|
||||
|
|
14
tests/modules/misc/qt/qt-basic.nix
Normal file
14
tests/modules/misc/qt/qt-basic.nix
Normal 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'
|
||||
'';
|
||||
};
|
||||
}
|
19
tests/modules/misc/qt/qt-platform-theme-gtk3.nix
Normal file
19
tests/modules/misc/qt/qt-platform-theme-gtk3.nix
Normal 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'
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue