mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 04:19:00 +02:00
nitrokey module: init
This commit is contained in:
parent
5e4a797888
commit
839647e630
41
nixos/modules/hardware/nitrokey.nix
Normal file
41
nixos/modules/hardware/nitrokey.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{ 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.
|
||||
'';
|
||||
};
|
||||
|
||||
group = mkOption {
|
||||
type = types.str;
|
||||
default = "nitrokey";
|
||||
example = "wheel";
|
||||
description = ''
|
||||
Grant access to Nitrokey devices to users in this group.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.udev.packages = [
|
||||
(pkgs.nitrokey-udev-rules.override (attrs:
|
||||
{ inherit (cfg) group; }
|
||||
))
|
||||
];
|
||||
users.extraGroups."${cfg.group}" = {};
|
||||
};
|
||||
}
|
|
@ -39,6 +39,7 @@
|
|||
./hardware/network/intel-3945abg.nix
|
||||
./hardware/network/ralink.nix
|
||||
./hardware/network/rtl8192c.nix
|
||||
./hardware/nitrokey.nix
|
||||
./hardware/opengl.nix
|
||||
./hardware/pcmcia.nix
|
||||
./hardware/usb-wwan.nix
|
||||
|
|
Loading…
Reference in a new issue