WIP dump1090-fa service
This commit is contained in:
parent
895c257573
commit
d8f1e5318a
2 changed files with 46 additions and 0 deletions
|
@ -41,6 +41,7 @@
|
||||||
"adb"
|
"adb"
|
||||||
"prometheus-exporters"
|
"prometheus-exporters"
|
||||||
"promtail"
|
"promtail"
|
||||||
|
"dump1090"
|
||||||
]
|
]
|
||||||
++ [ ./disko.nix ];
|
++ [ ./disko.nix ];
|
||||||
|
|
||||||
|
|
45
modules/dump1090/default.nix
Normal file
45
modules/dump1090/default.nix
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
{
|
||||||
|
systemd.services.dump1090-fa = {
|
||||||
|
description = "dump1090 ADS-B receiver (FlightAware customization)";
|
||||||
|
after = [ "network.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
DynamicUser = true;
|
||||||
|
SupplementaryGroups = "plugdev";
|
||||||
|
ExecStart = lib.escapeShellArgs [
|
||||||
|
(lib.getExe pkgs.dump1090)
|
||||||
|
"--net"
|
||||||
|
"--write-json"
|
||||||
|
"%t/dump1090-fa"
|
||||||
|
];
|
||||||
|
RuntimeDirectory = "dump1090-fa";
|
||||||
|
WorkingDirectory = "%t/dump1090-fa";
|
||||||
|
RuntimeDirectoryMode = 755;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
virtualHosts."dump1090-fa" = {
|
||||||
|
listen = [
|
||||||
|
{
|
||||||
|
addr = "0.0.0.0";
|
||||||
|
port = 8080;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
locations = {
|
||||||
|
"/".alias = "${pkgs.dump1090}/share/dump1090/";
|
||||||
|
"/data/".alias = "/run/dump1090-fa/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# TODO before upstreaming in nixpkgs
|
||||||
|
# - add `meta.mainProgram` to dump1090
|
||||||
|
# - rename dump1090 to dump1090-fa
|
||||||
|
# - optionally create an alias for dump1090
|
||||||
|
# - securing the systemd service (`systemd-analyze security dump1090-fa`)
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue