1
0
forked from c3d2/nix-config
nix-config/hosts/radiobert/readsb.nix

63 lines
1.6 KiB
Nix
Raw Normal View History

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