2014-04-14 16:26:48 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2012-03-20 05:41:13 +01:00
|
|
|
|
2014-04-14 16:26:48 +02:00
|
|
|
with lib;
|
2012-03-20 05:41:13 +01:00
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
options.services.hardware.pommed = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to use the pommed tool to handle Apple laptop keyboard hotkeys.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
configFile = mkOption {
|
2012-11-08 19:04:20 +01:00
|
|
|
default = "${pkgs.pommed}/etc/pommed.conf";
|
2012-03-20 05:41:13 +01:00
|
|
|
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";
|
2012-03-20 19:28:32 +01:00
|
|
|
|
|
|
|
path = [ pkgs.eject ];
|
2012-03-20 05:41:13 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|