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.
This commit is contained in:
Balletie 2016-12-18 20:50:49 +01:00 committed by Joachim Fasting
parent 66c745e30d
commit e5f5aa52e5
No known key found for this signature in database
GPG Key ID: 7544761007FE4E08

View File

@ -2,7 +2,9 @@
with lib;
{
let cfg = config.services.hardware.pommed;
defaultConf = "${pkgs.pommed_light}/etc/pommed.conf.mactel";
in {
options = {
@ -12,37 +14,37 @@ with lib;
type = types.bool;
default = false;
description = ''
Whether to use the pommed tool to handle Apple laptop keyboard hotkeys.
Whether to use the pommed tool to handle Apple laptop
keyboard hotkeys.
'';
};
configFile = mkOption {
type = types.path;
type = types.nullOr types.path;
default = null;
description = ''
The path to the <filename>pommed.conf</filename> file.
The path to the <filename>pommed.conf</filename> file. Leave
to null to use the default config file
(<filename>/etc/pommed.conf.mactel</filename>). See the
files <filename>/etc/pommed.conf.mactel</filename> and
<filename>/etc/pommed.conf.pmac</filename> for examples to
build on.
'';
};
};
};
config = mkIf config.services.hardware.pommed.enable {
environment.systemPackages = [ pkgs.polkit ];
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.polkit pkgs.pommed_light ];
environment.etc."pommed.conf".source = config.services.hardware.pommed.configFile;
services.hardware.pommed.configFile = "${pkgs.pommed}/etc/pommed.conf";
services.dbus.packages = [ pkgs.pommed ];
environment.etc."pommed.conf".source =
if cfg.configFile == null then defaultConf else cfg.configFile;
systemd.services.pommed = {
description = "Pommed hotkey management";
description = "Pommed Apple Hotkeys Daemon";
wantedBy = [ "multi-user.target" ];
after = [ "dbus.service" ];
postStop = "rm -f /var/run/pommed.pid";
script = "${pkgs.pommed}/bin/pommed";
serviceConfig.Type = "forking";
path = [ pkgs.eject ];
script = "${pkgs.pommed_light}/bin/pommed -f";
};
};
}