blob: a24557b40ba13e72efc285a01dd689910dc95c36 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
{ config, lib, pkgs, ... }:
with lib;
{
options = {
services.hardware.pommed = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to use the pommed tool to handle Apple laptop keyboard hotkeys.
'';
};
configFile = mkOption {
type = types.path;
description = ''
The path to the <filename>pommed.conf</filename> file.
'';
};
};
};
config = mkIf config.services.hardware.pommed.enable {
environment.systemPackages = [ pkgs.polkit ];
environment.etc."pommed.conf".source = config.services.hardware.pommed.configFile;
services.hardware.pommed.configFile = "${pkgs.pommed}/etc/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";
path = [ pkgs.eject ];
};
};
}
|