Skip to content

Commit

Permalink
nixos/qt: set QT_PLUGIN_PATH and QML2_IMPORT_PATH when enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyinstarlight committed Jan 16, 2023
1 parent a5b65a6 commit 185874d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions nixos/modules/config/qt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 185874d

Please sign in to comment.