inputMethod service: init
This commit is contained in:
parent
3ed3f061da
commit
3ad12f2dec
7 changed files with 34 additions and 52 deletions
29
nixos/modules/i18n/inputMethod/default.nix
Normal file
29
nixos/modules/i18n/inputMethod/default.nix
Normal file
|
@ -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>
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -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 ];
|
||||
|
|
|
@ -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 ];
|
||||
|
||||
|
|
|
@ -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 ];
|
||||
|
||||
|
|
|
@ -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 ];
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
./hardware/video/nvidia.nix
|
||||
./hardware/video/ati.nix
|
||||
./hardware/video/webcam/facetimehd.nix
|
||||
./i18n/inputMethod/default.nix
|
||||
./i18n/inputMethod/fcitx.nix
|
||||
./i18n/inputMethod/ibus.nix
|
||||
./i18n/inputMethod/nabi.nix
|
||||
|
|
|
@ -60,7 +60,6 @@ with lib;
|
|||
(mkRenamedOptionModule [ "services" "tarsnap" "config" ] [ "services" "tarsnap" "archives" ])
|
||||
|
||||
# ibus
|
||||
(mkRenamedOptionModule [ "programs" "ibus" "enable" ] [ "i18n" "inputMethod" "ibus" "enable" ])
|
||||
(mkRenamedOptionModule [ "programs" "ibus" "plugins" ] [ "i18n" "inputMethod" "ibus" "engines" ])
|
||||
|
||||
# proxy
|
||||
|
|
Loading…
Reference in a new issue