···
5
+
let cfg = config.services.hardware.pommed;
6
+
defaultConf = "${pkgs.pommed_light}/etc/pommed.conf.mactel";
···
15
-
Whether to use the pommed tool to handle Apple laptop keyboard hotkeys.
17
+
Whether to use the pommed tool to handle Apple laptop
23
+
type = types.nullOr types.path;
22
-
The path to the <filename>pommed.conf</filename> file.
26
+
The path to the <filename>pommed.conf</filename> file. Leave
27
+
to null to use the default config file
28
+
(<filename>/etc/pommed.conf.mactel</filename>). See the
29
+
files <filename>/etc/pommed.conf.mactel</filename> and
30
+
<filename>/etc/pommed.conf.pmac</filename> for examples to
29
-
config = mkIf config.services.hardware.pommed.enable {
30
-
environment.systemPackages = [ pkgs.polkit ];
38
+
config = mkIf cfg.enable {
39
+
environment.systemPackages = [ pkgs.polkit pkgs.pommed_light ];
32
-
environment.etc."pommed.conf".source = config.services.hardware.pommed.configFile;
34
-
services.hardware.pommed.configFile = "${pkgs.pommed}/etc/pommed.conf";
36
-
services.dbus.packages = [ pkgs.pommed ];
41
+
environment.etc."pommed.conf".source =
42
+
if cfg.configFile == null then defaultConf else cfg.configFile;
systemd.services.pommed = {
39
-
description = "Pommed hotkey management";
45
+
description = "Pommed Apple Hotkeys Daemon";
wantedBy = [ "multi-user.target" ];
41
-
after = [ "dbus.service" ];
42
-
postStop = "rm -f /var/run/pommed.pid";
43
-
script = "${pkgs.pommed}/bin/pommed";
44
-
serviceConfig.Type = "forking";
45
-
path = [ pkgs.eject ];
47
+
script = "${pkgs.pommed_light}/bin/pommed -f";