summary refs log tree commit diff
path: root/nixos/modules/hardware/nitrokey.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/hardware/nitrokey.nix')
-rw-r--r--nixos/modules/hardware/nitrokey.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/nixos/modules/hardware/nitrokey.nix b/nixos/modules/hardware/nitrokey.nix
new file mode 100644
index 00000000000..baa07203118
--- /dev/null
+++ b/nixos/modules/hardware/nitrokey.nix
@@ -0,0 +1,27 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+  cfg = config.hardware.nitrokey;
+
+in
+
+{
+  options.hardware.nitrokey = {
+    enable = mkOption {
+      type = types.bool;
+      default = false;
+      description = ''
+        Enables udev rules for Nitrokey devices. By default grants access
+        to users in the "nitrokey" group. You may want to install the
+        nitrokey-app package, depending on your device and needs.
+      '';
+    };
+  };
+
+  config = mkIf cfg.enable {
+    services.udev.packages = [ pkgs.nitrokey-udev-rules ];
+  };
+}