mirror of
https://github.com/nix-community/home-manager
synced 2024-12-25 19:29:47 +01:00
qt: workaround issue when i18n.inputMethod.enabled = 'fcitx5'
This commit is contained in:
parent
89acf6a4f9
commit
e529050043
3 changed files with 12 additions and 6 deletions
|
@ -28,8 +28,9 @@ in {
|
|||
GTK_IM_MODULE = "fcitx";
|
||||
QT_IM_MODULE = "fcitx";
|
||||
XMODIFIERS = "@im=fcitx";
|
||||
QT_PLUGIN_PATH =
|
||||
"${fcitx5Package}/${pkgs.qt6.qtbase.qtPluginPrefix}:\${QT_PLUGIN_PATH}";
|
||||
# Using mkDefault here since we override this value in qt module if enabled
|
||||
QT_PLUGIN_PATH = lib.mkDefault
|
||||
"$QT_PLUGIN_PATH\${QT_PLUGIN_PATH:+:}${fcitx5Package}/${pkgs.qt6.qtbase.qtPluginPrefix}";
|
||||
};
|
||||
|
||||
systemd.user.services.fcitx5-daemon = {
|
||||
|
|
|
@ -130,6 +130,7 @@ in {
|
|||
envVars = let
|
||||
inherit (config.home) profileDirectory;
|
||||
qtVersions = with pkgs; [ qt5 qt6 ];
|
||||
makeQtPath = prefix: basePath: qt: "${basePath}/${qt.qtbase.${prefix}}";
|
||||
in lib.filterAttrs (n: v: v != null) {
|
||||
QT_QPA_PLATFORMTHEME = if cfg.platformTheme == "gtk" then
|
||||
"gtk2"
|
||||
|
@ -140,12 +141,15 @@ in {
|
|||
QT_STYLE_OVERRIDE = cfg.style.name;
|
||||
QT_PLUGIN_PATH = "$QT_PLUGIN_PATH\${QT_PLUGIN_PATH:+:}"
|
||||
+ (lib.concatStringsSep ":"
|
||||
(map (qt: "${profileDirectory}/${qt.qtbase.qtPluginPrefix}")
|
||||
qtVersions));
|
||||
# Workaround issue with home.sessionVariables that does not support
|
||||
# multiple different values since fcitx5 also needs to set QT_PLUGIN_PATH.
|
||||
(lib.optional (config.i18n.inputMethod == "fcitx5")
|
||||
(makeQtPath "qtPluginPrefix" config.i18n.inputMethod.package
|
||||
pkgs.qt6) ++ (map (makeQtPath "qtPluginPrefix" profileDirectory)
|
||||
qtVersions)));
|
||||
QML2_IMPORT_PATH = "$QML2_IMPORT_PATH\${QML2_IMPORT_PATH:+:}"
|
||||
+ (lib.concatStringsSep ":"
|
||||
(map (qt: "${profileDirectory}/${qt.qtbase.qtQmlPrefix}")
|
||||
qtVersions));
|
||||
(map (makeQtPath "qtQmlPrefix" profileDirectory) qtVersions));
|
||||
};
|
||||
|
||||
in lib.mkIf (cfg.enable && cfg.platformTheme != null) {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
enable = true;
|
||||
platformTheme = "gtk";
|
||||
};
|
||||
i18n.inputMethod.enabled = "fcitx5";
|
||||
|
||||
nmt.script = ''
|
||||
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
|
||||
|
|
Loading…
Reference in a new issue