1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 20:21:14 +00:00
nixpkgs/nixos/modules/hardware/rtl-sdr.nix
Alexandre Macabies b9750a9b57 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.
2020-09-30 20:39:58 +02:00

21 lines
507 B
Nix

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