Merge pull request #125303 from Vonfry/fcitx5/autostart

nixos/fcitx5: autostart with xserver

authored by

Sandro and committed by
GitHub
9751baf8 8b517501

+25 -20
+25 -20
nixos/modules/i18n/input-method/fcitx5.nix
··· 6 6 im = config.i18n.inputMethod; 7 7 cfg = im.fcitx5; 8 8 fcitx5Package = pkgs.fcitx5-with-addons.override { inherit (cfg) addons; }; 9 - in 10 - { 11 - options = { 12 - i18n.inputMethod.fcitx5 = { 13 - addons = mkOption { 14 - type = with types; listOf package; 15 - default = []; 16 - example = with pkgs; [ fcitx5-rime ]; 17 - description = '' 18 - Enabled Fcitx5 addons. 19 - ''; 20 - }; 9 + in { 10 + options = { 11 + i18n.inputMethod.fcitx5 = { 12 + addons = mkOption { 13 + type = with types; listOf package; 14 + default = []; 15 + example = with pkgs; [ fcitx5-rime ]; 16 + description = '' 17 + Enabled Fcitx5 addons. 18 + ''; 21 19 }; 22 20 }; 21 + }; 23 22 24 - config = mkIf (im.enabled == "fcitx5") { 25 - i18n.inputMethod.package = fcitx5Package; 23 + config = mkIf (im.enabled == "fcitx5") { 24 + i18n.inputMethod.package = fcitx5Package; 26 25 27 - environment.variables = { 28 - GTK_IM_MODULE = "fcitx"; 29 - QT_IM_MODULE = "fcitx"; 30 - XMODIFIERS = "@im=fcitx"; 31 - }; 26 + environment.variables = { 27 + GTK_IM_MODULE = "fcitx"; 28 + QT_IM_MODULE = "fcitx"; 29 + XMODIFIERS = "@im=fcitx"; 32 30 }; 33 - } 31 + 32 + systemd.user.services.fcitx5-daemon = { 33 + enable = true; 34 + script = "${fcitx5Package}/bin/fcitx5"; 35 + wantedBy = [ "graphical-session.target" ]; 36 + }; 37 + }; 38 + }