fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ config , pkgs , lib , ...} : 2 3with lib ; 4let 5 6cfg = config . i18n . inputMethod ; 7 8gtk2Cache = pkgs . runCommandLocal "gtk2-immodule.cache" { 9buildInputs = [ pkgs . gtk2 cfg . package ]; 10} '' 11mkdir -p $ out /etc/gtk-2.0/ 12GTK_PATH = ${ cfg . package } /lib/gtk-2.0/ \ 13gtk-query-immodules-2.0 > $ out /etc/gtk-2.0/immodules.cache 14'' ; 15 16gtk3Cache = pkgs . runCommandLocal "gtk3-immodule.cache" { 17buildInputs = [ pkgs . gtk3 cfg . package ]; 18} '' 19mkdir -p $ out /etc/gtk-3.0/ 20GTK_PATH = ${ cfg . package } /lib/gtk-3.0/ \ 21gtk-query-immodules-3.0 > $ out /etc/gtk-3.0/immodules.cache 22'' ; 23 24in { 25imports = [ ./fcitx5.nix ./hime.nix ./kime.nix ./nabi.nix ./uim.nix ]; 26 27options . i18n = { 28inputMethod = { 29enabled = mkOption { 30type = types . nullOr 31( types . enum [ "fcitx" "fcitx5" "nabi" "uim" "hime" "kime" ]); 32default = null ; 33example = "fcitx5" ; 34description = '' 35Select the enabled input method. Input methods are software to input 36symbols that are not available on standard input devices. 37 38Input methods are especially used to input Chinese, Japanese and 39Korean characters. 40 41Currently the following input methods are available in Home Manager: 42 43`fcitx5` 44: A customizable lightweight input method. 45The next generation of fcitx. 46Addons (including engines, dictionaries, skins) can be added using 47[](#opt-i18n.inputMethod.fcitx5.addons). 48 49`nabi` 50: A Korean input method based on XIM. Nabi doesn't support Qt 5. 51 52`uim` 53: The "universal input method" is a library with an XIM bridge. 54uim mainly supports Chinese, Japanese and Korean. 55 56`hime` 57: An extremely easy-to-use input method framework. 58 59`kime` 60: A Korean IME. 61'' ; 62}; 63 64package = mkOption { 65internal = true ; 66type = types . nullOr types . path ; 67default = null ; 68description = '' 69The input method method package. 70'' ; 71}; 72}; 73}; 74 75config = mkIf ( cfg . enabled != null ) { 76assertions = [ 77( hm . assertions . assertPlatform "i18n.inputMethod" pkgs platforms . linux ) 78{ 79assertion = cfg . enabled != "fcitx" ; 80message = "fcitx has been removed, please use fcitx5 instead" ; 81} 82]; 83 84home . packages = [ cfg . package gtk2Cache gtk3Cache ]; 85}; 86 87meta . maintainers = with lib ; [ hm . maintainers . kranzes ]; 88}