about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/modules/i18n/inputMethod/nabi.nix37
-rw-r--r--nixos/modules/module-list.nix1
2 files changed, 38 insertions, 0 deletions
diff --git a/nixos/modules/i18n/inputMethod/nabi.nix b/nixos/modules/i18n/inputMethod/nabi.nix
new file mode 100644
index 0000000000000..7f97135fee1e8
--- /dev/null
+++ b/nixos/modules/i18n/inputMethod/nabi.nix
@@ -0,0 +1,37 @@
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+let 
+  cfg = config.i18n.inputMethod.nabi;
+in
+{
+  options = {
+
+    i18n.inputMethod.nabi = {
+      enable = mkOption {
+        type    = types.bool;
+        default = false;
+        example = true;
+        description = ''
+          Enable nabi input method.
+          Nabi can be used to input Korean.
+        '';
+      };
+    };
+
+  };
+{
+  config = mkIf cfg.enable {
+    environment.systemPackages = [ pkgs.nabi ];
+    qtPlugins  = [ pkgs.nabi ];
+
+    environment.variables = {
+      GTK_IM_MODULE = "nabi";
+      QT_IM_MODULE  = "nabi";
+      XMODIFIERS    = "@im=nabi";
+    };
+
+    services.xserver.displayManager.sessionCommands = "${pkgs.nabi}/bin/nabi &";
+  };
+}
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 9a7083c3ce8f9..7fe4a90a1354e 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -45,6 +45,7 @@
   ./hardware/video/webcam/facetimehd.nix
   ./i18n/inputMethod/fcitx.nix
   ./i18n/inputMethod/ibus.nix
+  ./i18n/inputMethod/nabi.nix
   ./i18n/inputMethod/uim.nix
   ./installer/tools/auto-upgrade.nix
   ./installer/tools/nixos-checkout.nix