From 185874df63be2dec1988f652b2bed7e4b104d431 Mon Sep 17 00:00:00 2001 From: Lily Foster Date: Sun, 15 Jan 2023 22:08:47 -0500 Subject: [PATCH] nixos/qt: set QT_PLUGIN_PATH and QML2_IMPORT_PATH when enabled --- nixos/modules/config/qt.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/nixos/modules/config/qt.nix b/nixos/modules/config/qt.nix index 35defb8fbd99..6405166920e0 100644 --- a/nixos/modules/config/qt.nix +++ b/nixos/modules/config/qt.nix @@ -102,9 +102,17 @@ in config = mkIf cfg.enable { - environment.variables.QT_QPA_PLATFORMTHEME = cfg.platformTheme; + environment.variables = { + QT_QPA_PLATFORMTHEME = cfg.platformTheme; + QT_STYLE_OVERRIDE = mkIf (! (isQt5ct || isLxqt || isKde)) cfg.style; + }; - environment.variables.QT_STYLE_OVERRIDE = mkIf (! (isQt5ct || isLxqt || isKde)) cfg.style; + environment.profileRelativeSessionVariables = let + qtVersions = with pkgs; [ qt5 qt6 ]; + in { + QT_PLUGIN_PATH = map (qt: "/${qt.qtbase.qtPluginPrefix}") qtVersions; + QML2_IMPORT_PATH = map (qt: "/${qt.qtbase.qtQmlPrefix}") qtVersions; + }; environment.systemPackages = packages;