Add a module for the pommed tool for Apple laptop keyboards.

svn path=/nixos/trunk/; revision=33286
This commit is contained in:
Shea Levy 2012-03-20 04:41:13 +00:00
parent 6435207dd1
commit 0d67d95f32
2 changed files with 48 additions and 0 deletions

View File

@ -75,6 +75,7 @@
./services/hardware/hal.nix
./services/hardware/nvidia-optimus.nix
./services/hardware/pcscd.nix
./services/hardware/pommed.nix
./services/hardware/sane.nix
./services/hardware/udev.nix
./services/hardware/udisks.nix

View File

@ -0,0 +1,47 @@
{ config, pkgs, ... }:
with pkgs.lib;
{
options.services.hardware.pommed = {
enable = mkOption {
default = false;
description = ''
Whether to use the pommed tool to handle Apple laptop keyboard hotkeys.
'';
};
configFile = mkOption {
default = builtins.toPath "${pkgs.pommed}/etc/pommed.conf";
description = ''
The contents of the pommed.conf file.
'';
};
};
config = mkIf config.services.hardware.pommed.enable {
environment.systemPackages = [ pkgs.polkit ];
environment.etc = [
{ source = config.services.hardware.pommed.configFile;
target = "pommed.conf";
}
];
services.dbus.packages = [ pkgs.pommed ];
jobs.pommed = { name = "pommed";
description = "Pommed hotkey management";
startOn = "started dbus";
postStop = "rm -f /var/run/pommed.pid";
exec = "${pkgs.pommed}/bin/pommed";
daemonType = "fork";
};
};
}