summary refs log tree commit diff
path: root/nixos/modules/programs/uim.nix
blob: fc25ba6f9694c28f57784c4c05c9ca86e094efe4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ config, pkgs, lib, ... }:

with lib;

let
  cfg = config.uim;
in
{
  options = {
    uim = {
      enable = mkOption {
        type = types.bool;
        default = false;
        example = true;
        description = "enable UIM input method";
      };
    };
  };

  config = mkIf cfg.enable {
    environment.systemPackages = [ pkgs.uim ];
    gtkPlugins = [ pkgs.uim ];
    qtPlugins = [ pkgs.uim ];
    environment.variables.GTK_IM_MODULE = "uim";
    environment.variables.QT_IM_MODULE = "uim";
    environment.variables.XMODIFIERS = "@im=uim";
    services.xserver.displayManager.sessionCommands = "uim-xim &";
  };
}