1{ config, pkgs, lib, ... }:
2
3with lib;
4
5let
6 cfg = config.uim;
7in
8{
9 options = {
10
11 uim = {
12 enable = mkOption {
13 type = types.bool;
14 default = false;
15 example = true;
16 description = "Enable UIM input method";
17 };
18 };
19
20 };
21
22 config = mkIf cfg.enable {
23 environment.systemPackages = [ pkgs.uim ];
24 gtkPlugins = [ pkgs.uim ];
25 qtPlugins = [ pkgs.uim ];
26 environment.variables.GTK_IM_MODULE = "uim";
27 environment.variables.QT_IM_MODULE = "uim";
28 environment.variables.XMODIFIERS = "@im=uim";
29 services.xserver.displayManager.sessionCommands = "uim-xim &";
30 };
31}