nixpkgs/nixos/modules/services/hardware/pommed.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.3 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
with lib;
let cfg = config.services.hardware.pommed;
defaultConf = "${pkgs.pommed_light}/etc/pommed.conf.mactel";
in {
options = {
services.hardware.pommed = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Whether to use the pommed tool to handle Apple laptop
keyboard hotkeys.
'';
};
configFile = mkOption {
type = types.nullOr types.path;
default = null;
description = lib.mdDoc ''
The path to the {file}`pommed.conf` file. Leave
to null to use the default config file
({file}`/etc/pommed.conf.mactel`). See the
files {file}`/etc/pommed.conf.mactel` and
{file}`/etc/pommed.conf.pmac` for examples to
build on.
'';
};
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.polkit pkgs.pommed_light ];
environment.etc."pommed.conf".source =
if cfg.configFile == null then defaultConf else cfg.configFile;
2016-01-06 06:50:18 +00:00
systemd.services.pommed = {
description = "Pommed Apple Hotkeys Daemon";
2016-01-06 06:50:18 +00:00
wantedBy = [ "multi-user.target" ];
script = "${pkgs.pommed_light}/bin/pommed -f";
};
};
}