Merge pull request #211003 from lilyinstarlight/fix/qt6-plugin-path

nixos/qt: set QT_PLUGIN_PATH and QML2_IMPORT_PATH when enabled
This commit is contained in:
Nick Cao 2023-01-16 18:34:23 +08:00 committed by GitHub
commit 7ace936995
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;