3
0
Fork 0
forked from mirrors/nixpkgs

nixos/hardware/rtl-sdr: new module

This is a very thin module to ensure "plugdev" user exists and some udev
rules are enabled, a prerequisite for using rtl-sdr.
This commit is contained in:
Alexandre Macabies 2020-08-29 02:12:07 +02:00
parent f816402fd0
commit b9750a9b57
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
let
cfg = config.hardware.rtl-sdr;
in {
options.hardware.rtl-sdr = {
enable = lib.mkEnableOption ''
Enables rtl-sdr udev rules and ensures 'plugdev' group exists.
This is a prerequisite to using devices supported by rtl-sdr without
being root, since rtl-sdr USB descriptors will be owned by plugdev
through udev.
'';
};
config = lib.mkIf cfg.enable {
services.udev.packages = [ pkgs.rtl-sdr ];
users.groups.plugdev = {};
};
}

View file

@ -59,6 +59,7 @@
./hardware/pcmcia.nix
./hardware/printers.nix
./hardware/raid/hpsa.nix
./hardware/rtl-sdr.nix
./hardware/steam-hardware.nix
./hardware/system-76.nix
./hardware/tuxedo-keyboard.nix