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