about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/hardware/hackrf.nix
blob: 7f03b765bbdaf18a4abd6f3f116492a3e2ffcfac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 = { };
  };
}