nixos/hardware/hackrf: new module

This is a very this module to enable the
hackrf udev rules and ensure the "plugdev"
group they use exists.
This commit is contained in:
Ivan Jager 2021-12-27 15:37:32 -06:00
parent 87a43a4b22
commit ca0fbf9739
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,23 @@
{ config, lib, pkgs, ... }:
let
cfg = config.hardware.hackrf;
in
{
options.hardware.hackrf = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Enables hackrf udev rules and ensures 'plugdev' group exists.
This is a prerequisite to using HackRF devices without being root, since HackRF USB descriptors will be owned by plugdev through udev.
'';
};
};
config = lib.mkIf cfg.enable {
services.udev.packages = [ pkgs.hackrf ];
users.groups.plugdev = { };
};
}

View file

@ -53,6 +53,7 @@
./hardware/flirc.nix
./hardware/gpgsmartcards.nix
./hardware/i2c.nix
./hardware/hackrf.nix
./hardware/sensor/hddtemp.nix
./hardware/sensor/iio.nix
./hardware/keyboard/teck.nix