summaryrefslogtreecommitdiffstats
path: root/nixos/modules/i18n
diff options
context:
space:
mode:
authorEric Sagnes <eric.sagnes@gmail.com>2016-02-16 22:52:25 +0900
committerEric Sagnes <eric.sagnes@gmail.com>2016-02-17 20:44:29 +0900
commit4a199d99552046e2ffd743d501d4ee4696038b42 (patch)
tree2e77bf141e43ad14a495a61752659cdb03719b77 /nixos/modules/i18n
parent2dac18aa01303be95dcf56cf4e0fa01ff30af05f (diff)
uim service: init
Diffstat (limited to 'nixos/modules/i18n')
-rw-r--r--nixos/modules/i18n/inputMethod/uim.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/nixos/modules/i18n/inputMethod/uim.nix b/nixos/modules/i18n/inputMethod/uim.nix
new file mode 100644
index 000000000000..0154cdc5057a
--- /dev/null
+++ b/nixos/modules/i18n/inputMethod/uim.nix
@@ -0,0 +1,48 @@
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+let
+ cfg = config.i18n.inputMethod.uim;
+in
+{
+ options = {
+
+ i18n.inputMethod.uim = {
+ enable = mkOption {
+ type = types.bool;
+ default = false;
+ example = true;
+ description = ''
+ Enable uim input method.
+ Uim can be used to input of Chinese, Korean, Japanese and other special characters.
+ '';
+ };
+ toolbar = mkOption {
+ type = types.enum [ "gtk" "gtk3" "gtk-systray" "gtk3-systray" "qt4" ];
+ default = "gtk";
+ example = "gtk-systray";
+ description = ''
+ selected UIM toolbar.
+ '';
+ };
+ };
+
+ };
+
+ config = mkIf cfg.enable {
+ environment.systemPackages = [ pkgs.uim ];
+ gtkPlugins = [ pkgs.uim ];
+ qtPlugins = [ pkgs.uim ];
+
+ environment.variables = {
+ GTK_IM_MODULE = "uim";
+ QT_IM_MODULE = "uim";
+ XMODIFIERS = "@im=uim";
+ };
+ services.xserver.displayManager.sessionCommands = ''
+ ${pkgs.uim}/bin/uim-xim &
+ ${pkgs.uim}/bin/uim-toolbar-${cfg.toolbar} &
+ '';
+ };
+}