2017-01-12 19:25:14 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.hardware.ckb;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.hardware.ckb = {
|
|
|
|
enable = mkEnableOption "the Corsair keyboard/mouse driver";
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.ckb;
|
|
|
|
defaultText = "pkgs.ckb";
|
|
|
|
description = ''
|
|
|
|
The package implementing the Corsair keyboard/mouse driver.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
|
|
|
|
systemd.services.ckb = {
|
2018-05-06 20:23:20 +02:00
|
|
|
description = "Corsair Keyboards and Mice Daemon";
|
2017-01-12 19:25:14 +01:00
|
|
|
wantedBy = ["multi-user.target"];
|
2018-05-06 19:58:51 +02:00
|
|
|
script = "${cfg.package}/bin/ckb-next-daemon";
|
2017-01-12 19:25:14 +01:00
|
|
|
serviceConfig = {
|
2018-05-06 20:23:20 +02:00
|
|
|
Restart = "on-failure";
|
2017-01-12 19:25:14 +01:00
|
|
|
StandardOutput = "syslog";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
maintainers = with lib.maintainers; [ kierdavis ];
|
|
|
|
};
|
|
|
|
}
|