3
0
Fork 0
forked from mirrors/nixpkgs

Add programs.ibus config option to enable ibus and plugins.

This commit is contained in:
Gabriel Ebner 2015-03-10 19:26:41 +01:00
parent afeed64bbe
commit f222abea44
2 changed files with 52 additions and 0 deletions

View file

@ -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

View 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";
};
}