From c8e664839b00a31708f2a579685eea9b76c2fa8f Mon Sep 17 00:00:00 2001 From: Gavin John Date: Tue, 28 Jan 2025 11:11:29 -0800 Subject: [PATCH] nixos/rtl-sdr: modernize --- nixos/modules/hardware/rtl-sdr.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/modules/hardware/rtl-sdr.nix b/nixos/modules/hardware/rtl-sdr.nix index 05a3b5412412..28b4c89963ca 100644 --- a/nixos/modules/hardware/rtl-sdr.nix +++ b/nixos/modules/hardware/rtl-sdr.nix @@ -19,6 +19,7 @@ in 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 { @@ -27,7 +28,8 @@ in "e4000" "rtl2832" ]; - services.udev.packages = [ pkgs.rtl-sdr ]; + services.udev.packages = [ cfg.package ]; + environment.systemPackages = [ cfg.package ]; users.groups.plugdev = { }; }; }