input methods: fix gtk cache

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