tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
ibus service: refactoring
Eric Sagnes
10 years ago
52dd5337
7ec5dc92
+87
-77
9 changed files
expand all
collapse all
unified
split
nixos
modules
i18n
inputMethod
ibus.nix
module-list.nix
programs
ibus.nix
rename.nix
pkgs
tools
inputmethods
ibus-engines
ibus-anthy
default.nix
ibus-hangul
default.nix
ibus-mozc
default.nix
ibus-table
default.nix
ibus-table-others
default.nix
+52
nixos/modules/i18n/inputMethod/ibus.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
{ config, pkgs, lib, ... }:
2
+
3
+
with lib;
4
+
5
+
let
6
+
cfg = config.i18n.inputMethod.ibus;
7
+
ibusPackage = pkgs.ibus-with-plugins.override { plugins = cfg.engines; };
8
+
ibusEngine = types.package // {
9
+
name = "ibus-engine";
10
+
check = x: (lib.types.package.check x) && (attrByPath ["meta" "isIbusEngine"] false x);
11
+
};
12
+
in
13
+
{
14
+
options = {
15
+
i18n.inputMethod.ibus = {
16
+
enable = mkOption {
17
+
type = types.bool;
18
+
default = false;
19
+
example = true;
20
+
description = ''
21
+
Enable IBus input method.
22
+
IBus can be used input of Chinese, Korean, Japanese and other special characters.
23
+
'';
24
+
};
25
+
engines = mkOption {
26
+
type = with types; listOf ibusEngine;
27
+
default = [];
28
+
example = literalExample "with pkgs.ibus-engines; [ mozc hangul ]";
29
+
description = ''
30
+
Enabled IBus engines.
31
+
Available engines can be found by running `nix-env "<nixpkgs>" . -qaP -A ibus-engines`.
32
+
'';
33
+
};
34
+
};
35
+
};
36
+
37
+
config = mkIf cfg.enable {
38
+
# Without dconf enabled it is impossible to use IBus
39
+
environment.systemPackages = [ ibusPackage pkgs.gnome3.dconf ];
40
+
41
+
gtkPlugins = [ pkgs.ibus ];
42
+
qtPlugins = [ pkgs.ibus-qt ];
43
+
44
+
environment.variables = {
45
+
GTK_IM_MODULE = "ibus";
46
+
QT_IM_MODULE = "ibus";
47
+
XMODIFIERS = "@im=ibus";
48
+
};
49
+
50
+
services.xserver.displayManager.sessionCommands = "${ibusPackage}/bin/ibus-daemon --daemonize --xim --cache=none";
51
+
};
52
+
}
+1
-1
nixos/modules/module-list.nix
···
44
./hardware/video/ati.nix
45
./hardware/video/webcam/facetimehd.nix
46
./i18n/inputMethod/fcitx.nix
0
47
./installer/tools/auto-upgrade.nix
48
./installer/tools/nixos-checkout.nix
49
./installer/tools/tools.nix
···
67
./programs/environment.nix
68
./programs/freetds.nix
69
./programs/fish.nix
70
-
./programs/ibus.nix
71
./programs/kbdlight.nix
72
./programs/light.nix
73
./programs/man.nix
···
44
./hardware/video/ati.nix
45
./hardware/video/webcam/facetimehd.nix
46
./i18n/inputMethod/fcitx.nix
47
+
./i18n/inputMethod/ibus.nix
48
./installer/tools/auto-upgrade.nix
49
./installer/tools/nixos-checkout.nix
50
./installer/tools/tools.nix
···
68
./programs/environment.nix
69
./programs/freetds.nix
70
./programs/fish.nix
0
71
./programs/kbdlight.nix
72
./programs/light.nix
73
./programs/man.nix
-51
nixos/modules/programs/ibus.nix
···
1
-
{ config, pkgs, lib, ... }:
2
-
3
-
with lib;
4
-
5
-
let
6
-
cfg = config.programs.ibus;
7
-
in
8
-
{
9
-
options = {
10
-
11
-
programs.ibus = {
12
-
enable = mkOption {
13
-
type = types.bool;
14
-
default = false;
15
-
example = true;
16
-
description = "Enable IBus input method";
17
-
};
18
-
plugins = mkOption {
19
-
type = lib.types.listOf lib.types.path;
20
-
default = [];
21
-
description = ''
22
-
IBus plugin packages
23
-
'';
24
-
};
25
-
};
26
-
27
-
};
28
-
29
-
config = mkIf cfg.enable {
30
-
environment.systemPackages = [ pkgs.ibus pkgs.gnome3.dconf ];
31
-
32
-
gtkPlugins = [ pkgs.ibus ];
33
-
qtPlugins = [ pkgs.ibus-qt ];
34
-
35
-
environment.variables =
36
-
let
37
-
env = pkgs.buildEnv {
38
-
name = "ibus-env";
39
-
paths = [ pkgs.ibus ] ++ cfg.plugins;
40
-
};
41
-
in {
42
-
GTK_IM_MODULE = "ibus";
43
-
QT_IM_MODULE = "ibus";
44
-
XMODIFIERS = "@im=ibus";
45
-
46
-
IBUS_COMPONENT_PATH = "${env}/share/ibus/component";
47
-
};
48
-
49
-
services.xserver.displayManager.sessionCommands = "${pkgs.ibus}/bin/ibus-daemon --daemonize --xim --cache=none";
50
-
};
51
-
}
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
+4
nixos/modules/rename.nix
···
59
# Tarsnap
60
(mkRenamedOptionModule [ "services" "tarsnap" "config" ] [ "services" "tarsnap" "archives" ])
61
0
0
0
0
62
# proxy
63
(mkRenamedOptionModule [ "nix" "proxy" ] [ "networking" "proxy" "default" ])
64
···
59
# Tarsnap
60
(mkRenamedOptionModule [ "services" "tarsnap" "config" ] [ "services" "tarsnap" "archives" ])
61
62
+
# ibus
63
+
(mkRenamedOptionModule [ "programs" "ibus" "enable" ] [ "i18n" "inputMethod" "ibus" "enable" ])
64
+
(mkRenamedOptionModule [ "programs" "ibus" "plugins" ] [ "i18n" "inputMethod" "ibus" "engines" ])
65
+
66
# proxy
67
(mkRenamedOptionModule [ "nix" "proxy" ] [ "networking" "proxy" "default" ])
68
+6
-5
pkgs/tools/inputmethods/ibus-engines/ibus-anthy/default.nix
···
6
version = "1.5.8";
7
8
meta = with stdenv.lib; {
9
-
description = "IBus interface to the anthy input method";
10
-
homepage = http://wiki.github.com/fujiwarat/ibus-anthy;
11
-
license = licenses.gpl2Plus;
12
-
platforms = platforms.linux;
13
-
maintainers = with maintainers; [ gebner ericsagnes ];
0
14
};
15
16
preConfigure = "./autogen.sh --prefix=$out";
···
6
version = "1.5.8";
7
8
meta = with stdenv.lib; {
9
+
isIbusEngine = true;
10
+
description = "IBus interface to the anthy input method";
11
+
homepage = http://wiki.github.com/fujiwarat/ibus-anthy;
12
+
license = licenses.gpl2Plus;
13
+
platforms = platforms.linux;
14
+
maintainers = with maintainers; [ gebner ericsagnes ];
15
};
16
17
preConfigure = "./autogen.sh --prefix=$out";
+6
-5
pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix
···
29
'';
30
31
meta = with stdenv.lib; {
32
-
description = "Ibus Hangul engine.";
33
-
homepage = https://github.com/choehwanjin/ibus-hangul;
34
-
license = licenses.gpl2;
35
-
platforms = platforms.linux;
36
-
maintainers = with maintainers; [ ericsagnes ];
0
37
};
38
}
···
29
'';
30
31
meta = with stdenv.lib; {
32
+
isIbusEngine = true;
33
+
description = "Ibus Hangul engine.";
34
+
homepage = https://github.com/choehwanjin/ibus-hangul;
35
+
license = licenses.gpl2;
36
+
platforms = platforms.linux;
37
+
maintainers = with maintainers; [ ericsagnes ];
38
};
39
}
+6
-5
pkgs/tools/inputmethods/ibus-engines/ibus-mozc/default.nix
···
11
version = "2.17.2313.102";
12
13
meta = with clangStdenv.lib; {
14
-
description = "Japanese input method from Google";
15
-
homepage = http://code.google.com/p/mozc/;
16
-
license = licenses.free;
17
-
platforms = platforms.linux;
18
-
maintainers = with maintainers; [ gebner ericsagnes ];
0
19
};
20
21
nativeBuildInputs = [ gyp which ninja python pkgconfig ];
···
11
version = "2.17.2313.102";
12
13
meta = with clangStdenv.lib; {
14
+
isIbusEngine = true;
15
+
description = "Japanese input method from Google";
16
+
homepage = http://code.google.com/p/mozc/;
17
+
license = licenses.free;
18
+
platforms = platforms.linux;
19
+
maintainers = with maintainers; [ gebner ericsagnes ];
20
};
21
22
nativeBuildInputs = [ gyp which ninja python pkgconfig ];
+6
-5
pkgs/tools/inputmethods/ibus-engines/ibus-table-others/default.nix
···
20
'';
21
22
meta = with stdenv.lib; {
23
-
description = "Various table-based input methods for IBus";
24
-
homepage = https://github.com/moebiuscurve/ibus-table-others;
25
-
license = licenses.gpl3;
26
-
platforms = platforms.linux;
27
-
maintainers = with maintainers; [ mudri ];
0
28
};
29
}
···
20
'';
21
22
meta = with stdenv.lib; {
23
+
isIbusEngine = true;
24
+
description = "Various table-based input methods for IBus";
25
+
homepage = https://github.com/moebiuscurve/ibus-table-others;
26
+
license = licenses.gpl3;
27
+
platforms = platforms.linux;
28
+
maintainers = with maintainers; [ mudri ];
29
};
30
}
+6
-5
pkgs/tools/inputmethods/ibus-engines/ibus-table/default.nix
···
12
buildInputs = [ ibus pkgconfig python3 pythonPackages.pygobject3 ];
13
14
meta = with stdenv.lib; {
15
-
description = "An IBus framework for table-based input methods";
16
-
homepage = https://github.com/kaio/ibus-table/wiki;
17
-
license = licenses.lgpl21;
18
-
platforms = platforms.linux;
19
-
maintainers = with maintainers; [ mudri ];
0
20
};
21
}
···
12
buildInputs = [ ibus pkgconfig python3 pythonPackages.pygobject3 ];
13
14
meta = with stdenv.lib; {
15
+
isIbusEngine = true;
16
+
description = "An IBus framework for table-based input methods";
17
+
homepage = https://github.com/kaio/ibus-table/wiki;
18
+
license = licenses.lgpl21;
19
+
platforms = platforms.linux;
20
+
maintainers = with maintainers; [ mudri ];
21
};
22
}