mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 06:30:28 +00:00
qt: fix basic usage when just qt.enable = true
is set
This commit is contained in:
parent
9a4725afa6
commit
fff5204e5d
3 changed files with 23 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})
|
||||
++ (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,5 @@
|
|||
{
|
||||
qt-basic = ./qt-basic.nix;
|
||||
qt-platform-theme-gtk = ./qt-platform-theme-gtk.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'
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue