summary refs log tree commit diff
path: root/nixos/modules/hardware
diff options
context:
space:
mode:
authorKier Davis <kierdavis@gmail.com>2017-01-12 18:25:14 +0000
committerKier Davis <kierdavis@gmail.com>2017-01-12 18:25:14 +0000
commitea7a8bf2d990413685ec9ad2e4c4e24dad7aafa5 (patch)
tree8071552c53026e33fed9e3eec973e52b27dd65c4 /nixos/modules/hardware
parente91840cfb6b7778f8c29d455a2f24cffa1b4e43e (diff)
downloadnixlib-ea7a8bf2d990413685ec9ad2e4c4e24dad7aafa5.tar
nixlib-ea7a8bf2d990413685ec9ad2e4c4e24dad7aafa5.tar.gz
nixlib-ea7a8bf2d990413685ec9ad2e4c4e24dad7aafa5.tar.bz2
nixlib-ea7a8bf2d990413685ec9ad2e4c4e24dad7aafa5.tar.lz
nixlib-ea7a8bf2d990413685ec9ad2e4c4e24dad7aafa5.tar.xz
nixlib-ea7a8bf2d990413685ec9ad2e4c4e24dad7aafa5.tar.zst
nixlib-ea7a8bf2d990413685ec9ad2e4c4e24dad7aafa5.zip
ckb: init at 0.2.6
ckb is a driver for Corsair keyboards/mice. It also contains a graphical tool for configuring their LED backlight settings.

The driver is implemented as a userland daemon. A NixOS module is included that runs this as a systemd service.
Diffstat (limited to 'nixos/modules/hardware')
-rw-r--r--nixos/modules/hardware/ckb.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/nixos/modules/hardware/ckb.nix b/nixos/modules/hardware/ckb.nix
new file mode 100644
index 000000000000..8429572a8822
--- /dev/null
+++ b/nixos/modules/hardware/ckb.nix
@@ -0,0 +1,40 @@
+{ 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 = {
+        description = "Corsair Keyboard Daemon";
+        wantedBy = ["multi-user.target"];
+        script = "${cfg.package}/bin/ckb-daemon";
+        serviceConfig = {
+          Restart = "always";
+          StandardOutput = "syslog";
+        };
+      };
+    };
+
+    meta = {
+      maintainers = with lib.maintainers; [ kierdavis ];
+    };
+  }