2022-01-13 20:06:32 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.hardware.hackrf;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.hardware.hackrf = {
|
|
|
|
enable = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
|
|
|
default = false;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2022-01-13 20:06:32 +00:00
|
|
|
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 = { };
|
|
|
|
};
|
|
|
|
}
|