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 18 type = with types; listOf fcitxEngine; 19 19 default = []; 20 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 "&lt;nixpkgs&gt;" . -qaP -A fcitx-engines`. 24 - ''; 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}."; 25 29 }; 26 30 }; 27 31 ··· 29 33 30 34 config = mkIf (config.i18n.inputMethod.enabled == "fcitx") { 31 35 environment.systemPackages = [ fcitxPackage ]; 32 - gtkPlugins = [ fcitxPackage ]; 33 - qtPlugins = [ fcitxPackage ]; 34 36 35 37 environment.variables = { 36 38 GTK_IM_MODULE = "fcitx";
-1
nixos/modules/i18n/inputMethod/nabi.nix
··· 4 4 { 5 5 config = mkIf (config.i18n.inputMethod.enabled == "nabi") { 6 6 environment.systemPackages = [ pkgs.nabi ]; 7 - qtPlugins = [ pkgs.nabi ]; 8 7 9 8 environment.variables = { 10 9 GTK_IM_MODULE = "nabi";
-2
nixos/modules/i18n/inputMethod/uim.nix
··· 23 23 24 24 config = mkIf (config.i18n.inputMethod.enabled == "uim") { 25 25 environment.systemPackages = [ pkgs.uim ]; 26 - gtkPlugins = [ pkgs.uim ]; 27 - qtPlugins = [ pkgs.uim ]; 28 26 29 27 environment.variables = { 30 28 GTK_IM_MODULE = "uim";
-3
nixos/modules/module-list.nix
··· 7 7 ./config/fonts/fonts.nix 8 8 ./config/fonts/ghostscript.nix 9 9 ./config/gnu.nix 10 - ./config/gtk-exe-env.nix 11 10 ./config/i18n.nix 12 11 ./config/krb5.nix 13 12 ./config/ldap.nix ··· 16 15 ./config/nsswitch.nix 17 16 ./config/power-management.nix 18 17 ./config/pulseaudio.nix 19 - ./config/qt-plugin-env.nix 20 18 ./config/shells-environment.nix 21 19 ./config/swap.nix 22 20 ./config/sysctl.nix ··· 79 77 ./programs/shell.nix 80 78 ./programs/ssh.nix 81 79 ./programs/ssmtp.nix 82 - ./programs/uim.nix 83 80 ./programs/venus.nix 84 81 ./programs/wvdial.nix 85 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 }: 1 + { stdenv, fetchFromGitHub 2 + , automake, autoconf, libtool, pkgconfig 3 + , ibus, m17n_lib, m17n_db, gettext, python3, pygobject3 4 + }: 3 5 4 6 stdenv.mkDerivation rec { 5 7 name = "ibus-m17n-${version}"; ··· 12 14 sha256 = "1n0bvgc4jyksgvzrw5zs2pxcpxcn3gcc0j2kasbznm34fpv3frsr"; 13 15 }; 14 16 15 - buildInputs = [ 16 - ibus m17n_lib m17n_db automake autoconf gettext 17 - libtool pkgconfig python pythonPackages.pygobject3 17 + buildInputs = [ 18 + ibus m17n_lib m17n_db gettext 19 + python3 pygobject3 18 20 ]; 21 + 22 + nativeBuildInputs = [ automake autoconf libtool pkgconfig ]; 19 23 20 24 preConfigure = '' 21 25 autoreconf --verbose --force --install
+10 -3
pkgs/tools/inputmethods/ibus/wrapper.nix
··· 1 - { stdenv, runCommand, ibus, lndir, makeWrapper, plugins, hicolor_icon_theme }: 1 + { stdenv, runCommand, makeWrapper, lndir 2 + , dconf, hicolor_icon_theme, ibus, plugins 3 + }: 2 4 3 5 let 4 6 name = "ibus-with-plugins-" + (builtins.parseDrvName ibus.name).version; 5 7 env = { 8 + buildInputs = [ ibus ] ++ plugins; 6 9 nativeBuildInputs = [ lndir makeWrapper ]; 7 10 propagatedUserEnvPackages = [ hicolor_icon_theme ]; 8 11 paths = [ ibus ] ++ plugins; 12 + inherit (ibus) meta; 9 13 }; 10 14 command = '' 11 15 for dir in bin etc lib libexec share; do ··· 19 23 20 24 for prog in ibus ibus-daemon ibus-setup; do 21 25 wrapProgram "$out/bin/$prog" \ 22 - --suffix XDG_DATA_DIRS : "${hicolor_icon_theme}/share" \ 26 + --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \ 27 + --prefix GIO_EXTRA_MODULES : "${dconf}/lib/gio/modules" \ 23 28 --set IBUS_COMPONENT_PATH "$out/share/ibus/component/" \ 24 29 --set IBUS_DATAROOTDIR "$out/share" \ 25 30 --set IBUS_LIBEXECDIR "$out/libexec" \ ··· 29 34 --set IBUS_TABLE_DATA_DIR "$out/share" \ 30 35 --set IBUS_TABLE_LIB_LOCATION "$out/libexec" \ 31 36 --set IBUS_TABLE_LOCATION "$out/share/ibus-table" \ 32 - --set IBUS_TABLE_DEBUG_LEVEL 1 37 + --prefix PYTHONPATH : "$PYTHONPATH" \ 38 + --prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \ 39 + --suffix XDG_DATA_DIRS : "${hicolor_icon_theme}/share" 33 40 done 34 41 ''; 35 42 in
+4 -1
pkgs/top-level/all-packages.nix
··· 1180 1180 inherit (python3Packages) pygobject3; 1181 1181 }; 1182 1182 1183 - m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { }; 1183 + m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { 1184 + inherit (python3Packages) pygobject3; 1185 + }; 1184 1186 1185 1187 mozc = callPackage ../tools/inputmethods/ibus-engines/ibus-mozc { 1186 1188 inherit (pythonPackages) gyp; ··· 1198 1200 }; 1199 1201 1200 1202 ibus-with-plugins = callPackage ../tools/inputmethods/ibus/wrapper.nix { 1203 + inherit (gnome3) dconf; 1201 1204 plugins = [ ]; 1202 1205 }; 1203 1206