pommed service: use pommed-light

The pommed package was marked as broken. It is also severely
unmaintained. I therefore chose to replace it entirely with
`pommed-light`, for now.

authored by

Balletie and committed by
Joachim Fasting
e5f5aa52 66c745e3

+19 -17
+19 -17
nixos/modules/services/hardware/pommed.nix
··· 2 2 3 3 with lib; 4 4 5 - { 5 + let cfg = config.services.hardware.pommed; 6 + defaultConf = "${pkgs.pommed_light}/etc/pommed.conf.mactel"; 7 + in { 6 8 7 9 options = { 8 10 ··· 12 14 type = types.bool; 13 15 default = false; 14 16 description = '' 15 - Whether to use the pommed tool to handle Apple laptop keyboard hotkeys. 17 + Whether to use the pommed tool to handle Apple laptop 18 + keyboard hotkeys. 16 19 ''; 17 20 }; 18 21 19 22 configFile = mkOption { 20 - type = types.path; 23 + type = types.nullOr types.path; 24 + default = null; 21 25 description = '' 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 31 + build on. 23 32 ''; 24 33 }; 25 34 }; 26 35 27 36 }; 28 37 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 ]; 31 40 32 - environment.etc."pommed.conf".source = config.services.hardware.pommed.configFile; 33 - 34 - services.hardware.pommed.configFile = "${pkgs.pommed}/etc/pommed.conf"; 35 - 36 - services.dbus.packages = [ pkgs.pommed ]; 41 + environment.etc."pommed.conf".source = 42 + if cfg.configFile == null then defaultConf else cfg.configFile; 37 43 38 44 systemd.services.pommed = { 39 - description = "Pommed hotkey management"; 45 + description = "Pommed Apple Hotkeys Daemon"; 40 46 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"; 46 48 }; 47 49 }; 48 50 }