summary refs log tree commit diff
path: root/nixos/modules/i18n/input-method
diff options
context:
space:
mode:
authorVonfry <mail@vonfry.name>2021-06-02 07:50:11 +0800
committerVonfry <mail@vonfry.name>2021-06-05 09:22:58 +0800
commit195b26b95e2ae8a0c9ee7cb9c1e3d9faf6222d03 (patch)
tree707b8a9fcd7a45ef22f7857e36df57d9d357ad5e /nixos/modules/i18n/input-method
parent4542b54abd6ca91b1817294cfb67ccccdb72d3df (diff)
downloadnixpkgs-195b26b95e2ae8a0c9ee7cb9c1e3d9faf6222d03.tar
nixpkgs-195b26b95e2ae8a0c9ee7cb9c1e3d9faf6222d03.tar.gz
nixpkgs-195b26b95e2ae8a0c9ee7cb9c1e3d9faf6222d03.tar.bz2
nixpkgs-195b26b95e2ae8a0c9ee7cb9c1e3d9faf6222d03.tar.lz
nixpkgs-195b26b95e2ae8a0c9ee7cb9c1e3d9faf6222d03.tar.xz
nixpkgs-195b26b95e2ae8a0c9ee7cb9c1e3d9faf6222d03.tar.zst
nixpkgs-195b26b95e2ae8a0c9ee7cb9c1e3d9faf6222d03.zip
nixos/fcitx5: autostart with xserver
Diffstat (limited to 'nixos/modules/i18n/input-method')
-rw-r--r--nixos/modules/i18n/input-method/fcitx5.nix45
1 files changed, 25 insertions, 20 deletions
diff --git a/nixos/modules/i18n/input-method/fcitx5.nix b/nixos/modules/i18n/input-method/fcitx5.nix
index 44962d202fe..eecbe32fea4 100644
--- a/nixos/modules/i18n/input-method/fcitx5.nix
+++ b/nixos/modules/i18n/input-method/fcitx5.nix
@@ -6,28 +6,33 @@ let
   im = config.i18n.inputMethod;
   cfg = im.fcitx5;
   fcitx5Package = pkgs.fcitx5-with-addons.override { inherit (cfg) addons; };
-in
-  {
-    options = {
-      i18n.inputMethod.fcitx5 = {
-        addons = mkOption {
-          type = with types; listOf package;
-          default = [];
-          example = with pkgs; [ fcitx5-rime ];
-          description = ''
-            Enabled Fcitx5 addons.
-          '';
-        };
+in {
+  options = {
+    i18n.inputMethod.fcitx5 = {
+      addons = mkOption {
+        type = with types; listOf package;
+        default = [];
+        example = with pkgs; [ fcitx5-rime ];
+        description = ''
+          Enabled Fcitx5 addons.
+        '';
       };
     };
+  };
 
-    config = mkIf (im.enabled == "fcitx5") {
-      i18n.inputMethod.package = fcitx5Package;
+  config = mkIf (im.enabled == "fcitx5") {
+    i18n.inputMethod.package = fcitx5Package;
 
-      environment.variables = {
-        GTK_IM_MODULE = "fcitx";
-        QT_IM_MODULE = "fcitx";
-        XMODIFIERS = "@im=fcitx";
-      };
+    environment.variables = {
+      GTK_IM_MODULE = "fcitx";
+      QT_IM_MODULE = "fcitx";
+      XMODIFIERS = "@im=fcitx";
+    };
+
+    systemd.user.services.fcitx5-daemon = {
+      enable = true;
+      script = "${fcitx5Package}/bin/fcitx5";
+      wantedBy = [ "graphical-session.target" ];
     };
-  }
+  };
+}