summary refs log tree commit diff
path: root/nixos/modules/hardware/ckb-next.nix
diff options
context:
space:
mode:
authorNadrieril <nadrieril@gmail.com>2018-01-19 23:56:44 +0000
committerJörg Thalheim <joerg@thalheim.io>2018-11-15 16:49:38 +0000
commit99a8c45bdde5c59f5a7a7b7d57813f20fbb70a92 (patch)
tree2909a6993b2a6034246715bbdcdd9a6a463a396f /nixos/modules/hardware/ckb-next.nix
parentc48411a404a116e6f31948374fd94b3645af0f3a (diff)
downloadnixpkgs-99a8c45bdde5c59f5a7a7b7d57813f20fbb70a92.tar
nixpkgs-99a8c45bdde5c59f5a7a7b7d57813f20fbb70a92.tar.gz
nixpkgs-99a8c45bdde5c59f5a7a7b7d57813f20fbb70a92.tar.bz2
nixpkgs-99a8c45bdde5c59f5a7a7b7d57813f20fbb70a92.tar.lz
nixpkgs-99a8c45bdde5c59f5a7a7b7d57813f20fbb70a92.tar.xz
nixpkgs-99a8c45bdde5c59f5a7a7b7d57813f20fbb70a92.tar.zst
nixpkgs-99a8c45bdde5c59f5a7a7b7d57813f20fbb70a92.zip
nixos/ckb: Add option to restrict access to the devices to a particular group
fixes #34064
Diffstat (limited to 'nixos/modules/hardware/ckb-next.nix')
-rw-r--r--nixos/modules/hardware/ckb-next.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/modules/hardware/ckb-next.nix b/nixos/modules/hardware/ckb-next.nix
index a275fb8fd60..20b2756d8b2 100644
--- a/nixos/modules/hardware/ckb-next.nix
+++ b/nixos/modules/hardware/ckb-next.nix
@@ -10,6 +10,15 @@ in
     options.hardware.ckb-next = {
       enable = mkEnableOption "the Corsair keyboard/mouse driver";
 
+      gid = mkOption {
+        type = types.nullOr types.int;
+        default = null;
+        example = 100;
+        description = ''
+          Limit access to the ckb daemon to a particular group.
+        '';
+      };
+
       package = mkOption {
         type = types.package;
         default = pkgs.ckb-next;
@@ -26,8 +35,8 @@ in
       systemd.services.ckb-next = {
         description = "Corsair Keyboards and Mice Daemon";
         wantedBy = ["multi-user.target"];
-        script = "exec ${cfg.package}/bin/ckb-next-daemon";
         serviceConfig = {
+          ExecStart = "${cfg.package}/bin/ckb-next-daemon ${optionalString (cfg.gid != null) "--gid=${builtins.toString cfg.gid}"}";
           Restart = "on-failure";
           StandardOutput = "syslog";
         };