Files
nixpkgs/nixos/modules/hardware/rtl-sdr.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

38 lines
879 B
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.hardware.rtl-sdr;
in
{
options.hardware.rtl-sdr = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Enables rtl-sdr udev rules, ensures 'plugdev' group exists, and blacklists DVB kernel modules.
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.
'';
};
package = lib.mkPackageOption pkgs "rtl-sdr" { };
};
config = lib.mkIf cfg.enable {
boot.blacklistedKernelModules = [
"dvb_usb_rtl28xxu"
"e4000"
"rtl2832"
];
services.udev.packages = [ cfg.package ];
environment.systemPackages = [ cfg.package ];
users.groups.plugdev = { };
};
meta.maintainers = with lib.maintainers; [ pandapip1 ];
}