forked from mirrors/nixpkgs
Add programs.ibus config option to enable ibus and plugins.
This commit is contained in:
parent
afeed64bbe
commit
f222abea44
|
@ -60,6 +60,7 @@
|
|||
./programs/dconf.nix
|
||||
./programs/environment.nix
|
||||
./programs/info.nix
|
||||
./programs/ibus.nix
|
||||
./programs/light.nix
|
||||
./programs/nano.nix
|
||||
./programs/screen.nix
|
||||
|
|
51
nixos/modules/programs/ibus.nix
Normal file
51
nixos/modules/programs/ibus.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.ibus;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
|
||||
programs.ibus = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Enable IBus input method";
|
||||
};
|
||||
plugins = mkOption {
|
||||
type = lib.types.listOf lib.types.path;
|
||||
default = [];
|
||||
description = ''
|
||||
IBus plugin packages
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkgs.ibus ];
|
||||
|
||||
gtkPlugins = [ pkgs.ibus ];
|
||||
qtPlugins = [ pkgs.ibus ];
|
||||
|
||||
environment.variables =
|
||||
let
|
||||
env = pkgs.buildEnv {
|
||||
name = "ibus-env";
|
||||
paths = [ pkgs.ibus ] ++ cfg.plugins;
|
||||
};
|
||||
in {
|
||||
GTK_IM_MODULE = "ibus";
|
||||
QT_IM_MODULE = "ibus";
|
||||
XMODIFIERS = "@im=ibus";
|
||||
|
||||
IBUS_COMPONENT_PATH = "${env}/share/ibus/component";
|
||||
};
|
||||
|
||||
services.xserver.displayManager.sessionCommands = "${pkgs.ibus}/bin/ibus-daemon -d -t none";
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue