tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
Merge branch 'input-methods'
Thomas Tuegel
10 years ago
eaed5598
1af8a349
+31
-130
10 changed files
expand all
collapse all
unified
split
nixos
modules
config
gtk-exe-env.nix
qt-plugin-env.nix
i18n
inputMethod
fcitx.nix
nabi.nix
uim.nix
module-list.nix
programs
uim.nix
pkgs
tools
inputmethods
ibus
wrapper.nix
ibus-engines
ibus-m17n
default.nix
top-level
all-packages.nix
-41
nixos/modules/config/gtk-exe-env.nix
···
1
1
-
{ config, pkgs, lib, ... }:
2
2
-
3
3
-
{
4
4
-
imports = [
5
5
-
];
6
6
-
7
7
-
options = {
8
8
-
gtkPlugins = lib.mkOption {
9
9
-
type = lib.types.listOf lib.types.path;
10
10
-
default = [];
11
11
-
description = ''
12
12
-
Plugin packages for GTK+ such as input methods.
13
13
-
'';
14
14
-
};
15
15
-
};
16
16
-
17
17
-
config = {
18
18
-
environment.variables = if builtins.length config.gtkPlugins > 0
19
19
-
then
20
20
-
let
21
21
-
paths = [ pkgs.gtk2 pkgs.gtk3 ] ++ config.gtkPlugins;
22
22
-
env = pkgs.buildEnv {
23
23
-
name = "gtk-exe-env";
24
24
-
25
25
-
inherit paths;
26
26
-
27
27
-
postBuild = lib.concatStringsSep "\n"
28
28
-
(map (d: d.gtkExeEnvPostBuild or "") paths);
29
29
-
30
30
-
ignoreCollisions = true;
31
31
-
};
32
32
-
in {
33
33
-
GTK_EXE_PREFIX = builtins.toString env;
34
34
-
GTK_PATH = [
35
35
-
"${env}/lib/gtk-2.0"
36
36
-
"${env}/lib/gtk-3.0"
37
37
-
];
38
38
-
}
39
39
-
else {};
40
40
-
};
41
41
-
}
-37
nixos/modules/config/qt-plugin-env.nix
···
1
1
-
{ config, pkgs, lib, ... }:
2
2
-
3
3
-
{
4
4
-
imports = [
5
5
-
];
6
6
-
7
7
-
options = {
8
8
-
qtPlugins = lib.mkOption {
9
9
-
type = lib.types.listOf lib.types.path;
10
10
-
default = [];
11
11
-
description = ''
12
12
-
Plugin packages for Qt such as input methods.
13
13
-
'';
14
14
-
};
15
15
-
};
16
16
-
17
17
-
config = {
18
18
-
environment.variables = if builtins.length config.qtPlugins > 0
19
19
-
then
20
20
-
let
21
21
-
paths = [ pkgs.qt48 ] ++ config.qtPlugins;
22
22
-
env = pkgs.buildEnv {
23
23
-
name = "qt-plugin-env";
24
24
-
25
25
-
inherit paths;
26
26
-
27
27
-
postBuild = lib.concatStringsSep "\n"
28
28
-
(map (d: d.qtPluginEnvPostBuild or "") paths);
29
29
-
30
30
-
ignoreCollisions = true;
31
31
-
};
32
32
-
in {
33
33
-
QT_PLUGIN_PATH = [ (builtins.toString env) ];
34
34
-
}
35
35
-
else {};
36
36
-
};
37
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
21
-
description = ''
22
22
-
Enabled Fcitx engines.
23
23
-
Available engines can be found by running `nix-env "<nixpkgs>" . -qaP -A fcitx-engines`.
24
24
-
'';
21
21
+
description =
22
22
+
let
23
23
+
engines =
24
24
+
lib.concatStringsSep ", "
25
25
+
(map (name: "<literal>${name}</literal>")
26
26
+
(lib.attrNames pkgs.fcitx-engines));
27
27
+
in
28
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
32
-
gtkPlugins = [ fcitxPackage ];
33
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
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
26
-
gtkPlugins = [ pkgs.uim ];
27
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
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
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
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
1
-
{ config, pkgs, lib, ... }:
2
2
-
3
3
-
with lib;
4
4
-
5
5
-
let
6
6
-
cfg = config.uim;
7
7
-
in
8
8
-
{
9
9
-
options = {
10
10
-
11
11
-
uim = {
12
12
-
enable = mkOption {
13
13
-
type = types.bool;
14
14
-
default = false;
15
15
-
example = true;
16
16
-
description = "Enable UIM input method";
17
17
-
};
18
18
-
};
19
19
-
20
20
-
};
21
21
-
22
22
-
config = mkIf cfg.enable {
23
23
-
environment.systemPackages = [ pkgs.uim ];
24
24
-
gtkPlugins = [ pkgs.uim ];
25
25
-
qtPlugins = [ pkgs.uim ];
26
26
-
environment.variables.GTK_IM_MODULE = "uim";
27
27
-
environment.variables.QT_IM_MODULE = "uim";
28
28
-
environment.variables.XMODIFIERS = "@im=uim";
29
29
-
services.xserver.displayManager.sessionCommands = "uim-xim &";
30
30
-
};
31
31
-
}
+9
-5
pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix
···
1
1
-
{ stdenv, fetchFromGitHub, ibus, m17n_lib, m17n_db, automake, autoconf,
2
2
-
gettext, libtool, pkgconfig, python, pythonPackages }:
1
1
+
{ stdenv, fetchFromGitHub
2
2
+
, automake, autoconf, libtool, pkgconfig
3
3
+
, ibus, m17n_lib, m17n_db, gettext, python3, pygobject3
4
4
+
}:
3
5
4
6
stdenv.mkDerivation rec {
5
7
name = "ibus-m17n-${version}";
···
12
14
sha256 = "1n0bvgc4jyksgvzrw5zs2pxcpxcn3gcc0j2kasbznm34fpv3frsr";
13
15
};
14
16
15
15
-
buildInputs = [
16
16
-
ibus m17n_lib m17n_db automake autoconf gettext
17
17
-
libtool pkgconfig python pythonPackages.pygobject3
17
17
+
buildInputs = [
18
18
+
ibus m17n_lib m17n_db gettext
19
19
+
python3 pygobject3
18
20
];
21
21
+
22
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
1
-
{ stdenv, runCommand, ibus, lndir, makeWrapper, plugins, hicolor_icon_theme }:
1
1
+
{ stdenv, runCommand, makeWrapper, lndir
2
2
+
, dconf, hicolor_icon_theme, ibus, plugins
3
3
+
}:
2
4
3
5
let
4
6
name = "ibus-with-plugins-" + (builtins.parseDrvName ibus.name).version;
5
7
env = {
8
8
+
buildInputs = [ ibus ] ++ plugins;
6
9
nativeBuildInputs = [ lndir makeWrapper ];
7
10
propagatedUserEnvPackages = [ hicolor_icon_theme ];
8
11
paths = [ ibus ] ++ plugins;
12
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
22
-
--suffix XDG_DATA_DIRS : "${hicolor_icon_theme}/share" \
26
26
+
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \
27
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
32
-
--set IBUS_TABLE_DEBUG_LEVEL 1
37
37
+
--prefix PYTHONPATH : "$PYTHONPATH" \
38
38
+
--prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \
39
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
1183
-
m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { };
1183
1183
+
m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n {
1184
1184
+
inherit (python3Packages) pygobject3;
1185
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
1203
+
inherit (gnome3) dconf;
1201
1204
plugins = [ ];
1202
1205
};
1203
1206