mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
24 lines
568 B
Nix
24 lines
568 B
Nix
|
{ config, lib, pkgs, ... }:
|
||
|
|
||
|
let
|
||
|
cfg = config.hardware.hackrf;
|
||
|
|
||
|
in
|
||
|
{
|
||
|
options.hardware.hackrf = {
|
||
|
enable = lib.mkOption {
|
||
|
type = lib.types.bool;
|
||
|
default = false;
|
||
|
description = lib.mdDoc ''
|
||
|
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 = { };
|
||
|
};
|
||
|
}
|