tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
input methods: fix gtk cache
Eric Sagnes
9 years ago
cfe062f2
3e2318ec
+47
-7
6 changed files
expand all
collapse all
unified
split
nixos
modules
config
system-path.nix
i18n
input-method
default.nix
fcitx.nix
ibus.nix
nabi.nix
uim.nix
+2
nixos/modules/config/system-path.nix
···
102
102
environment.pathsToLink =
103
103
[ "/bin"
104
104
"/etc/xdg"
105
105
+
"/etc/gtk-2.0"
106
106
+
"/etc/gtk-3.0"
105
107
"/info"
106
108
"/lib" # FIXME: remove and update debug-info.nix
107
109
"/sbin"
+39
-3
nixos/modules/i18n/input-method/default.nix
···
1
1
{ config, pkgs, lib, ... }:
2
2
3
3
with lib;
4
4
-
4
4
+
let
5
5
+
cfg = config.i18n.inputMethod;
6
6
+
gtk2_cache = pkgs.stdenv.mkDerivation {
7
7
+
preferLocalBuild = true;
8
8
+
allowSubstitutes = false;
9
9
+
name = "gtk2-immodule.cache";
10
10
+
buildInputs = [ pkgs.gtk cfg.package ];
11
11
+
buildCommand = ''
12
12
+
mkdir -p $out/etc/gtk-2.0/
13
13
+
GTK_PATH=${cfg.package}/lib/gtk-2.0/ gtk-query-immodules-2.0 > $out/etc/gtk-2.0/immodules.cache
14
14
+
'';
15
15
+
};
16
16
+
gtk3_cache = pkgs.stdenv.mkDerivation {
17
17
+
preferLocalBuild = true;
18
18
+
allowSubstitutes = false;
19
19
+
name = "gtk3-immodule.cache";
20
20
+
buildInputs = [ pkgs.gtk3 cfg.package ];
21
21
+
buildCommand = ''
22
22
+
mkdir -p $out/etc/gtk-3.0/
23
23
+
GTK_PATH=${cfg.package}/lib/gtk-3.0/ gtk-query-immodules-3.0 > $out/etc/gtk-3.0/immodules.cache
24
24
+
'';
25
25
+
};
26
26
+
in
5
27
{
6
6
-
options = {
7
7
-
i18n.inputMethod = {
28
28
+
options.i18n = {
29
29
+
inputMethod = {
8
30
enabled = mkOption {
9
31
type = types.nullOr (types.enum [ "ibus" "fcitx" "nabi" "uim" ]);
10
32
default = null;
···
24
46
</itemizedlist>
25
47
'';
26
48
};
49
49
+
50
50
+
package = mkOption {
51
51
+
internal = true;
52
52
+
type = types.path;
53
53
+
default = null;
54
54
+
description = ''
55
55
+
The input method method package.
56
56
+
'';
57
57
+
};
27
58
};
28
59
};
60
60
+
61
61
+
config = mkIf (cfg.enabled != null) {
62
62
+
environment.systemPackages = [ cfg.package gtk2_cache gtk3_cache ];
63
63
+
};
64
64
+
29
65
}
+1
-1
nixos/modules/i18n/input-method/fcitx.nix
···
32
32
};
33
33
34
34
config = mkIf (config.i18n.inputMethod.enabled == "fcitx") {
35
35
-
environment.systemPackages = [ fcitxPackage ];
35
35
+
i18n.inputMethod.package = fcitxPackage;
36
36
37
37
environment.variables = {
38
38
GTK_IM_MODULE = "fcitx";
+3
-1
nixos/modules/i18n/input-method/ibus.nix
···
41
41
};
42
42
43
43
config = mkIf (config.i18n.inputMethod.enabled == "ibus") {
44
44
+
i18n.inputMethod.package = ibusPackage;
45
45
+
44
46
# Without dconf enabled it is impossible to use IBus
45
47
environment.systemPackages = with pkgs; [
46
46
-
ibusPackage ibus-qt gnome3.dconf ibusAutostart
48
48
+
ibus-qt gnome3.dconf ibusAutostart
47
49
];
48
50
49
51
environment.variables = {
+1
-1
nixos/modules/i18n/input-method/nabi.nix
···
3
3
with lib;
4
4
{
5
5
config = mkIf (config.i18n.inputMethod.enabled == "nabi") {
6
6
-
environment.systemPackages = [ pkgs.nabi ];
6
6
+
i18n.inputMethod.package = pkgs.nabi;
7
7
8
8
environment.variables = {
9
9
GTK_IM_MODULE = "nabi";
+1
-1
nixos/modules/i18n/input-method/uim.nix
···
22
22
};
23
23
24
24
config = mkIf (config.i18n.inputMethod.enabled == "uim") {
25
25
-
environment.systemPackages = [ pkgs.uim ];
25
25
+
i18n.inputMethod.package = pkgs.uim;
26
26
27
27
environment.variables = {
28
28
GTK_IM_MODULE = "uim";