1 { config, lib, pkgs, ... }:
3 cfg = config.hardware.ckb-next;
8 (lib.mkRenamedOptionModule [ "hardware" "ckb" "enable" ] [ "hardware" "ckb-next" "enable" ])
9 (lib.mkRenamedOptionModule [ "hardware" "ckb" "package" ] [ "hardware" "ckb-next" "package" ])
12 options.hardware.ckb-next = {
13 enable = lib.mkEnableOption "the Corsair keyboard/mouse driver";
16 type = lib.types.nullOr lib.types.int;
20 Limit access to the ckb daemon to a particular group.
24 package = lib.mkPackageOption pkgs "ckb-next" { };
27 config = lib.mkIf cfg.enable {
28 environment.systemPackages = [ cfg.package ];
30 systemd.services.ckb-next = {
31 description = "Corsair Keyboards and Mice Daemon";
32 wantedBy = ["multi-user.target"];
34 ExecStart = "${cfg.package}/bin/ckb-next-daemon ${lib.optionalString (cfg.gid != null) "--gid=${builtins.toString cfg.gid}"}";
35 Restart = "on-failure";