input methods: fix gtk cache
This commit is contained in:
@@ -1,10 +1,32 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.i18n.inputMethod;
|
||||
gtk2_cache = pkgs.stdenv.mkDerivation {
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
name = "gtk2-immodule.cache";
|
||||
buildInputs = [ pkgs.gtk cfg.package ];
|
||||
buildCommand = ''
|
||||
mkdir -p $out/etc/gtk-2.0/
|
||||
GTK_PATH=${cfg.package}/lib/gtk-2.0/ gtk-query-immodules-2.0 > $out/etc/gtk-2.0/immodules.cache
|
||||
'';
|
||||
};
|
||||
gtk3_cache = pkgs.stdenv.mkDerivation {
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
name = "gtk3-immodule.cache";
|
||||
buildInputs = [ pkgs.gtk3 cfg.package ];
|
||||
buildCommand = ''
|
||||
mkdir -p $out/etc/gtk-3.0/
|
||||
GTK_PATH=${cfg.package}/lib/gtk-3.0/ gtk-query-immodules-3.0 > $out/etc/gtk-3.0/immodules.cache
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
i18n.inputMethod = {
|
||||
options.i18n = {
|
||||
inputMethod = {
|
||||
enabled = mkOption {
|
||||
type = types.nullOr (types.enum [ "ibus" "fcitx" "nabi" "uim" ]);
|
||||
default = null;
|
||||
@@ -24,6 +46,20 @@ with lib;
|
||||
</itemizedlist>
|
||||
'';
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
internal = true;
|
||||
type = types.path;
|
||||
default = null;
|
||||
description = ''
|
||||
The input method method package.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enabled != null) {
|
||||
environment.systemPackages = [ cfg.package gtk2_cache gtk3_cache ];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user