mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-14 16:46:09 +00:00
70eb64c025
svn path=/nixos/trunk/; revision=33302
50 lines
1,006 B
Nix
50 lines
1,006 B
Nix
{ config, pkgs, ... }:
|
|
|
|
with pkgs.lib;
|
|
|
|
{
|
|
|
|
options.services.hardware.pommed = {
|
|
enable = mkOption {
|
|
default = false;
|
|
description = ''
|
|
Whether to use the pommed tool to handle Apple laptop keyboard hotkeys.
|
|
'';
|
|
};
|
|
|
|
configFile = mkOption {
|
|
default = builtins.toPath "${pkgs.pommed}/etc/pommed.conf";
|
|
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";
|
|
|
|
path = [ pkgs.eject ];
|
|
};
|
|
};
|
|
}
|