Merge branch 'input-methods'

+31 -130
-41
nixos/modules/config/gtk-exe-env.nix
··· 1 - { config, pkgs, lib, ... }: 2 - 3 - { 4 - imports = [ 5 - ]; 6 - 7 - options = { 8 - gtkPlugins = lib.mkOption { 9 - type = lib.types.listOf lib.types.path; 10 - default = []; 11 - description = '' 12 - Plugin packages for GTK+ such as input methods. 13 - ''; 14 - }; 15 - }; 16 - 17 - config = { 18 - environment.variables = if builtins.length config.gtkPlugins > 0 19 - then 20 - let 21 - paths = [ pkgs.gtk2 pkgs.gtk3 ] ++ config.gtkPlugins; 22 - env = pkgs.buildEnv { 23 - name = "gtk-exe-env"; 24 - 25 - inherit paths; 26 - 27 - postBuild = lib.concatStringsSep "\n" 28 - (map (d: d.gtkExeEnvPostBuild or "") paths); 29 - 30 - ignoreCollisions = true; 31 - }; 32 - in { 33 - GTK_EXE_PREFIX = builtins.toString env; 34 - GTK_PATH = [ 35 - "${env}/lib/gtk-2.0" 36 - "${env}/lib/gtk-3.0" 37 - ]; 38 - } 39 - else {}; 40 - }; 41 - }
···
-37
nixos/modules/config/qt-plugin-env.nix
··· 1 - { config, pkgs, lib, ... }: 2 - 3 - { 4 - imports = [ 5 - ]; 6 - 7 - options = { 8 - qtPlugins = lib.mkOption { 9 - type = lib.types.listOf lib.types.path; 10 - default = []; 11 - description = '' 12 - Plugin packages for Qt such as input methods. 13 - ''; 14 - }; 15 - }; 16 - 17 - config = { 18 - environment.variables = if builtins.length config.qtPlugins > 0 19 - then 20 - let 21 - paths = [ pkgs.qt48 ] ++ config.qtPlugins; 22 - env = pkgs.buildEnv { 23 - name = "qt-plugin-env"; 24 - 25 - inherit paths; 26 - 27 - postBuild = lib.concatStringsSep "\n" 28 - (map (d: d.qtPluginEnvPostBuild or "") paths); 29 - 30 - ignoreCollisions = true; 31 - }; 32 - in { 33 - QT_PLUGIN_PATH = [ (builtins.toString env) ]; 34 - } 35 - else {}; 36 - }; 37 - }
···
+8 -6
nixos/modules/i18n/inputMethod/fcitx.nix
··· 18 type = with types; listOf fcitxEngine; 19 default = []; 20 example = literalExample "with pkgs.fcitx-engines; [ mozc hangul ]"; 21 - description = '' 22 - Enabled Fcitx engines. 23 - Available engines can be found by running `nix-env "<nixpkgs>" . -qaP -A fcitx-engines`. 24 - ''; 25 }; 26 }; 27 ··· 29 30 config = mkIf (config.i18n.inputMethod.enabled == "fcitx") { 31 environment.systemPackages = [ fcitxPackage ]; 32 - gtkPlugins = [ fcitxPackage ]; 33 - qtPlugins = [ fcitxPackage ]; 34 35 environment.variables = { 36 GTK_IM_MODULE = "fcitx";
··· 18 type = with types; listOf fcitxEngine; 19 default = []; 20 example = literalExample "with pkgs.fcitx-engines; [ mozc hangul ]"; 21 + description = 22 + let 23 + engines = 24 + lib.concatStringsSep ", " 25 + (map (name: "<literal>${name}</literal>") 26 + (lib.attrNames pkgs.fcitx-engines)); 27 + in 28 + "Enabled Fcitx engines. Available engines are: ${engines}."; 29 }; 30 }; 31 ··· 33 34 config = mkIf (config.i18n.inputMethod.enabled == "fcitx") { 35 environment.systemPackages = [ fcitxPackage ]; 36 37 environment.variables = { 38 GTK_IM_MODULE = "fcitx";
-1
nixos/modules/i18n/inputMethod/nabi.nix
··· 4 { 5 config = mkIf (config.i18n.inputMethod.enabled == "nabi") { 6 environment.systemPackages = [ pkgs.nabi ]; 7 - qtPlugins = [ pkgs.nabi ]; 8 9 environment.variables = { 10 GTK_IM_MODULE = "nabi";
··· 4 { 5 config = mkIf (config.i18n.inputMethod.enabled == "nabi") { 6 environment.systemPackages = [ pkgs.nabi ]; 7 8 environment.variables = { 9 GTK_IM_MODULE = "nabi";
-2
nixos/modules/i18n/inputMethod/uim.nix
··· 23 24 config = mkIf (config.i18n.inputMethod.enabled == "uim") { 25 environment.systemPackages = [ pkgs.uim ]; 26 - gtkPlugins = [ pkgs.uim ]; 27 - qtPlugins = [ pkgs.uim ]; 28 29 environment.variables = { 30 GTK_IM_MODULE = "uim";
··· 23 24 config = mkIf (config.i18n.inputMethod.enabled == "uim") { 25 environment.systemPackages = [ pkgs.uim ]; 26 27 environment.variables = { 28 GTK_IM_MODULE = "uim";
-3
nixos/modules/module-list.nix
··· 7 ./config/fonts/fonts.nix 8 ./config/fonts/ghostscript.nix 9 ./config/gnu.nix 10 - ./config/gtk-exe-env.nix 11 ./config/i18n.nix 12 ./config/krb5.nix 13 ./config/ldap.nix ··· 16 ./config/nsswitch.nix 17 ./config/power-management.nix 18 ./config/pulseaudio.nix 19 - ./config/qt-plugin-env.nix 20 ./config/shells-environment.nix 21 ./config/swap.nix 22 ./config/sysctl.nix ··· 79 ./programs/shell.nix 80 ./programs/ssh.nix 81 ./programs/ssmtp.nix 82 - ./programs/uim.nix 83 ./programs/venus.nix 84 ./programs/wvdial.nix 85 ./programs/xfs_quota.nix
··· 7 ./config/fonts/fonts.nix 8 ./config/fonts/ghostscript.nix 9 ./config/gnu.nix 10 ./config/i18n.nix 11 ./config/krb5.nix 12 ./config/ldap.nix ··· 15 ./config/nsswitch.nix 16 ./config/power-management.nix 17 ./config/pulseaudio.nix 18 ./config/shells-environment.nix 19 ./config/swap.nix 20 ./config/sysctl.nix ··· 77 ./programs/shell.nix 78 ./programs/ssh.nix 79 ./programs/ssmtp.nix 80 ./programs/venus.nix 81 ./programs/wvdial.nix 82 ./programs/xfs_quota.nix
-31
nixos/modules/programs/uim.nix
··· 1 - { config, pkgs, lib, ... }: 2 - 3 - with lib; 4 - 5 - let 6 - cfg = config.uim; 7 - in 8 - { 9 - options = { 10 - 11 - uim = { 12 - enable = mkOption { 13 - type = types.bool; 14 - default = false; 15 - example = true; 16 - description = "Enable UIM input method"; 17 - }; 18 - }; 19 - 20 - }; 21 - 22 - config = mkIf cfg.enable { 23 - environment.systemPackages = [ pkgs.uim ]; 24 - gtkPlugins = [ pkgs.uim ]; 25 - qtPlugins = [ pkgs.uim ]; 26 - environment.variables.GTK_IM_MODULE = "uim"; 27 - environment.variables.QT_IM_MODULE = "uim"; 28 - environment.variables.XMODIFIERS = "@im=uim"; 29 - services.xserver.displayManager.sessionCommands = "uim-xim &"; 30 - }; 31 - }
···
+9 -5
pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix
··· 1 - { stdenv, fetchFromGitHub, ibus, m17n_lib, m17n_db, automake, autoconf, 2 - gettext, libtool, pkgconfig, python, pythonPackages }: 3 4 stdenv.mkDerivation rec { 5 name = "ibus-m17n-${version}"; ··· 12 sha256 = "1n0bvgc4jyksgvzrw5zs2pxcpxcn3gcc0j2kasbznm34fpv3frsr"; 13 }; 14 15 - buildInputs = [ 16 - ibus m17n_lib m17n_db automake autoconf gettext 17 - libtool pkgconfig python pythonPackages.pygobject3 18 ]; 19 20 preConfigure = '' 21 autoreconf --verbose --force --install
··· 1 + { stdenv, fetchFromGitHub 2 + , automake, autoconf, libtool, pkgconfig 3 + , ibus, m17n_lib, m17n_db, gettext, python3, pygobject3 4 + }: 5 6 stdenv.mkDerivation rec { 7 name = "ibus-m17n-${version}"; ··· 14 sha256 = "1n0bvgc4jyksgvzrw5zs2pxcpxcn3gcc0j2kasbznm34fpv3frsr"; 15 }; 16 17 + buildInputs = [ 18 + ibus m17n_lib m17n_db gettext 19 + python3 pygobject3 20 ]; 21 + 22 + nativeBuildInputs = [ automake autoconf libtool pkgconfig ]; 23 24 preConfigure = '' 25 autoreconf --verbose --force --install
+10 -3
pkgs/tools/inputmethods/ibus/wrapper.nix
··· 1 - { stdenv, runCommand, ibus, lndir, makeWrapper, plugins, hicolor_icon_theme }: 2 3 let 4 name = "ibus-with-plugins-" + (builtins.parseDrvName ibus.name).version; 5 env = { 6 nativeBuildInputs = [ lndir makeWrapper ]; 7 propagatedUserEnvPackages = [ hicolor_icon_theme ]; 8 paths = [ ibus ] ++ plugins; 9 }; 10 command = '' 11 for dir in bin etc lib libexec share; do ··· 19 20 for prog in ibus ibus-daemon ibus-setup; do 21 wrapProgram "$out/bin/$prog" \ 22 - --suffix XDG_DATA_DIRS : "${hicolor_icon_theme}/share" \ 23 --set IBUS_COMPONENT_PATH "$out/share/ibus/component/" \ 24 --set IBUS_DATAROOTDIR "$out/share" \ 25 --set IBUS_LIBEXECDIR "$out/libexec" \ ··· 29 --set IBUS_TABLE_DATA_DIR "$out/share" \ 30 --set IBUS_TABLE_LIB_LOCATION "$out/libexec" \ 31 --set IBUS_TABLE_LOCATION "$out/share/ibus-table" \ 32 - --set IBUS_TABLE_DEBUG_LEVEL 1 33 done 34 ''; 35 in
··· 1 + { stdenv, runCommand, makeWrapper, lndir 2 + , dconf, hicolor_icon_theme, ibus, plugins 3 + }: 4 5 let 6 name = "ibus-with-plugins-" + (builtins.parseDrvName ibus.name).version; 7 env = { 8 + buildInputs = [ ibus ] ++ plugins; 9 nativeBuildInputs = [ lndir makeWrapper ]; 10 propagatedUserEnvPackages = [ hicolor_icon_theme ]; 11 paths = [ ibus ] ++ plugins; 12 + inherit (ibus) meta; 13 }; 14 command = '' 15 for dir in bin etc lib libexec share; do ··· 23 24 for prog in ibus ibus-daemon ibus-setup; do 25 wrapProgram "$out/bin/$prog" \ 26 + --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \ 27 + --prefix GIO_EXTRA_MODULES : "${dconf}/lib/gio/modules" \ 28 --set IBUS_COMPONENT_PATH "$out/share/ibus/component/" \ 29 --set IBUS_DATAROOTDIR "$out/share" \ 30 --set IBUS_LIBEXECDIR "$out/libexec" \ ··· 34 --set IBUS_TABLE_DATA_DIR "$out/share" \ 35 --set IBUS_TABLE_LIB_LOCATION "$out/libexec" \ 36 --set IBUS_TABLE_LOCATION "$out/share/ibus-table" \ 37 + --prefix PYTHONPATH : "$PYTHONPATH" \ 38 + --prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \ 39 + --suffix XDG_DATA_DIRS : "${hicolor_icon_theme}/share" 40 done 41 ''; 42 in
+4 -1
pkgs/top-level/all-packages.nix
··· 1180 inherit (python3Packages) pygobject3; 1181 }; 1182 1183 - m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { }; 1184 1185 mozc = callPackage ../tools/inputmethods/ibus-engines/ibus-mozc { 1186 inherit (pythonPackages) gyp; ··· 1198 }; 1199 1200 ibus-with-plugins = callPackage ../tools/inputmethods/ibus/wrapper.nix { 1201 plugins = [ ]; 1202 }; 1203
··· 1180 inherit (python3Packages) pygobject3; 1181 }; 1182 1183 + m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { 1184 + inherit (python3Packages) pygobject3; 1185 + }; 1186 1187 mozc = callPackage ../tools/inputmethods/ibus-engines/ibus-mozc { 1188 inherit (pythonPackages) gyp; ··· 1200 }; 1201 1202 ibus-with-plugins = callPackage ../tools/inputmethods/ibus/wrapper.nix { 1203 + inherit (gnome3) dconf; 1204 plugins = [ ]; 1205 }; 1206