3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/modules/hardware/hackrf.nix
Ivan Jager ca0fbf9739 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.
2021-12-31 10:24:49 -06:00

24 lines
558 B
Nix

{ 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 = { };
};
}