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