about summary refs log tree commit diff
path: root/nixos/modules/i18n
diff options
context:
space:
mode:
authorEric Sagnes <eric.sagnes@gmail.com>2016-02-16 23:10:46 +0900
committerEric Sagnes <eric.sagnes@gmail.com>2016-02-19 08:52:18 +0900
commit3ad12f2decdab0da872899107917e8c247fd07dc (patch)
tree41b504d6bcf422fa8161330e607f030ba94cf1c3 /nixos/modules/i18n
parent3ed3f061dad30f9ae8b7712b0b46140b415d4ab3 (diff)
inputMethod service: init
Diffstat (limited to 'nixos/modules/i18n')
-rw-r--r--nixos/modules/i18n/inputMethod/default.nix29
-rw-r--r--nixos/modules/i18n/inputMethod/fcitx.nix11
-rw-r--r--nixos/modules/i18n/inputMethod/ibus.nix11
-rw-r--r--nixos/modules/i18n/inputMethod/nabi.nix22
-rw-r--r--nixos/modules/i18n/inputMethod/uim.nix11
5 files changed, 33 insertions, 51 deletions
diff --git a/nixos/modules/i18n/inputMethod/default.nix b/nixos/modules/i18n/inputMethod/default.nix
new file mode 100644
index 0000000000000..7e6a25bfb0847
--- /dev/null
+++ b/nixos/modules/i18n/inputMethod/default.nix
@@ -0,0 +1,29 @@
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+{
+  options = {
+    i18n.inputMethod = {
+      enabled = mkOption {
+        type    = types.nullOr (types.enum [ "ibus" "fcitx" "nabi" "uim" ]);
+        default = null;
+        example = "fcitx";
+        description = ''
+          Select the enabled input method. Input methods is a software to input symbols that are not available on standard input devices.
+
+          Input methods are specially used to input Chinese, Japanese and Korean characters.
+
+          Currently the following input methods are available in NixOS:
+
+          <itemizedlist>
+          <listitem><para>ibus: The intelligent input bus, extra input engines can be added using <literal>i18n.inputMethod.ibus.engines</literal>.</para></listitem>
+          <listitem><para>fcitx: A customizable lightweight input method, extra input engines can be added using <literal>i18n.inputMethod.fcitx.engines</literal>.</para></listitem>
+          <listitem><para>nabi: A Korean input method based on XIM. Nabi doesn't support Qt 5.</para></listitem>
+          <listitem><para>uim: The universal input method, is a library with a XIM bridge. uim mainly support Chinese, Japanese and Korean.</para></listitem>
+          </itemizedlist>
+        '';
+      };
+    };
+  };
+}
diff --git a/nixos/modules/i18n/inputMethod/fcitx.nix b/nixos/modules/i18n/inputMethod/fcitx.nix
index b0e7578810adc..f168f4451703f 100644
--- a/nixos/modules/i18n/inputMethod/fcitx.nix
+++ b/nixos/modules/i18n/inputMethod/fcitx.nix
@@ -14,15 +14,6 @@ in
   options = {
 
     i18n.inputMethod.fcitx = {
-      enable = mkOption {
-        type    = types.bool;
-        default = false;
-        example = true;
-        description = ''
-          Enable Fcitx input method.
-          Fcitx can be used to input of Chinese, Korean, Japanese and other special characters.
-        '';
-      };
       engines = mkOption {
         type    = with types; listOf fcitxEngine;
         default = [];
@@ -36,7 +27,7 @@ in
 
   };
 
-  config = mkIf cfg.enable {
+  config = mkIf (config.i18n.inputMethod.enabled == "fcitx") {
     environment.systemPackages = [ fcitxPackage ];
     gtkPlugins = [ fcitxPackage ];
     qtPlugins  = [ fcitxPackage ];
diff --git a/nixos/modules/i18n/inputMethod/ibus.nix b/nixos/modules/i18n/inputMethod/ibus.nix
index e4bc15cf8912a..86059751a3d20 100644
--- a/nixos/modules/i18n/inputMethod/ibus.nix
+++ b/nixos/modules/i18n/inputMethod/ibus.nix
@@ -13,15 +13,6 @@ in
 {
   options = {
     i18n.inputMethod.ibus = {
-      enable = mkOption {
-        type    = types.bool;
-        default = false;
-        example = true;
-        description = ''
-          Enable IBus input method.
-          IBus can be used input of Chinese, Korean, Japanese and other special characters.
-        '';
-      };
       engines = mkOption {
         type    = with types; listOf ibusEngine;
         default = [];
@@ -34,7 +25,7 @@ in
     };
   };
 
-  config = mkIf cfg.enable {
+  config = mkIf (config.i18n.inputMethod.enabled == "ibus") {
     # Without dconf enabled it is impossible to use IBus
     environment.systemPackages = [ ibusPackage pkgs.gnome3.dconf ];
 
diff --git a/nixos/modules/i18n/inputMethod/nabi.nix b/nixos/modules/i18n/inputMethod/nabi.nix
index 7f97135fee1e8..8c39659551309 100644
--- a/nixos/modules/i18n/inputMethod/nabi.nix
+++ b/nixos/modules/i18n/inputMethod/nabi.nix
@@ -1,28 +1,8 @@
 { 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 {
+  config = mkIf (config.i18n.inputMethod.enabled == "nabi") {
     environment.systemPackages = [ pkgs.nabi ];
     qtPlugins  = [ pkgs.nabi ];
 
diff --git a/nixos/modules/i18n/inputMethod/uim.nix b/nixos/modules/i18n/inputMethod/uim.nix
index 0154cdc5057a4..401e1932f70c4 100644
--- a/nixos/modules/i18n/inputMethod/uim.nix
+++ b/nixos/modules/i18n/inputMethod/uim.nix
@@ -9,15 +9,6 @@ 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";
@@ -30,7 +21,7 @@ in
 
   };
 
-  config = mkIf cfg.enable {
+  config = mkIf (config.i18n.inputMethod.enabled == "uim") {
     environment.systemPackages = [ pkgs.uim ];
     gtkPlugins = [ pkgs.uim ];
     qtPlugins  = [ pkgs.uim ];