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