Merge branch 'input-methods'

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