fork/home-manager

git clone https://git.julia.blue/fork/home-manager

sefidelim/fcitx5: fix missing plugins on Qt6 (#4468)7a46e6cb

master
1.1 KiB45 linesraw
1{ config, pkgs, lib, ... }:
2
3with lib;
4
5let
6  im = config.i18n.inputMethod;
7  cfg = im.fcitx5;
8  fcitx5Package = pkgs.fcitx5-with-addons.override { inherit (cfg) addons; };
9in {
10  options = {
11    i18n.inputMethod.fcitx5 = {
12      addons = mkOption {
13        type = with types; listOf package;
14        default = [ ];
15        example = literalExpression "with pkgs; [ fcitx5-rime ]";
16        description = ''
17          Enabled Fcitx5 addons.
18        '';
19      };
20    };
21  };
22
23  config = mkIf (im.enabled == "fcitx5") {
24    i18n.inputMethod.package = fcitx5Package;
25
26    home.sessionVariables = {
27      GLFW_IM_MODULE = "ibus"; # IME support in kitty
28      GTK_IM_MODULE = "fcitx";
29      QT_IM_MODULE = "fcitx";
30      XMODIFIERS = "@im=fcitx";
31      QT_PLUGIN_PATH =
32        "${fcitx5Package}/${pkgs.qt6.qtbase.qtPluginPrefix}:\${QT_PLUGIN_PATH}";
33    };
34
35    systemd.user.services.fcitx5-daemon = {
36      Unit = {
37        Description = "Fcitx5 input method editor";
38        PartOf = [ "graphical-session.target" ];
39      };
40      Service.ExecStart = "${fcitx5Package}/bin/fcitx5";
41      Install.WantedBy = [ "graphical-session.target" ];
42    };
43  };
44
45}