{ config, pkgs, ... }: { boot.blacklistedKernelModules = [ # no watching TV intended "dvb_usb_rtl28xxu" ]; users.users.readsb = { isSystemUser = true; group = "adsb"; }; users.groups.adsb = {}; systemd.services.readsb = { wantedBy = [ "multi-user.target" ]; serviceConfig = { ExecStart = "${pkgs.readsb}/bin/readsb --modeac --aggressive --dcfilter --quiet --gain=-10 --lon=13.7281 --lat=51.081 --net --net-sbs-port=30003"; User = "readsb"; Group = "adsb"; ProtectSystem = "full"; ProtectHome = true; Restart = "always"; RestartSec = "10s"; }; }; users.users.sbs2json = { isSystemUser = true; group = "adsb"; }; # SHIM because readsb has no web server like dump1090 systemd.services.sbs2json = { wantedBy = [ "multi-user.target" ]; requires = [ "readsb.service" ]; serviceConfig = { ExecStart = "${pkgs.ruby}/bin/ruby ${./sbs2json.rb}"; User = "sbs2json"; Group = "adsb"; ProtectSystem = "full"; ProtectHome = true; Restart = "always"; RestartSec = "10s"; }; }; users.users.dump1090-influxdb = { isSystemUser = true; group = "adsb"; }; systemd.services.dump1090-influxdb = { wantedBy = [ "multi-user.target" ]; requires = [ "readsb.service" ]; serviceConfig = { ExecStart = "${pkgs.dump1090-influxdb}/bin/dump1090-influxdb"; User = "dump1090-influxdb"; Group = "adsb"; ProtectSystem = "full"; ProtectHome = true; Restart = "always"; RestartSec = "10s"; }; }; environment.systemPackages = with pkgs; [ dump1090_sdrplus readsb ]; }