about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/hardware/openrazer.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/hardware/openrazer.nix')
-rw-r--r--nixpkgs/nixos/modules/hardware/openrazer.nix23
1 files changed, 18 insertions, 5 deletions
diff --git a/nixpkgs/nixos/modules/hardware/openrazer.nix b/nixpkgs/nixos/modules/hardware/openrazer.nix
index b5c3d6744142..bd9fc485e17e 100644
--- a/nixpkgs/nixos/modules/hardware/openrazer.nix
+++ b/nixpkgs/nixos/modules/hardware/openrazer.nix
@@ -49,7 +49,9 @@ in
 {
   options = {
     hardware.openrazer = {
-      enable = mkEnableOption "OpenRazer drivers and userspace daemon";
+      enable = mkEnableOption ''
+        OpenRazer drivers and userspace daemon.
+      '';
 
       verboseLogging = mkOption {
         type = types.bool;
@@ -92,6 +94,15 @@ in
           generate a heatmap.
         '';
       };
+
+      users = mkOption {
+        type = with types; listOf str;
+        default = [];
+        description = ''
+          Usernames to be added to the "openrazer" group, so that they
+          can start and interact with the OpenRazer userspace daemon.
+        '';
+      };
     };
   };
 
@@ -106,10 +117,12 @@ in
     services.udev.packages = [ kernelPackages.openrazer ];
     services.dbus.packages = [ dbusServiceFile ];
 
-    # A user must be a member of the plugdev group in order to start
-    # the openrazer-daemon. Therefore we make sure that the plugdev
-    # group exists.
-    users.groups.plugdev = {};
+    # A user must be a member of the openrazer group in order to start
+    # the openrazer-daemon. Therefore we make sure that the group
+    # exists.
+    users.groups.openrazer = {
+      members = cfg.users;
+    };
 
     systemd.user.services.openrazer-daemon = {
       description = "Daemon to manage razer devices in userspace";