nix-config/hosts/sdrweb/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

89 lines
2.0 KiB
Nix
Raw Normal View History

2022-01-16 13:26:37 +01:00
{ zentralwerk, config, pkgs, ... }:
2021-10-07 23:00:50 +02:00
{
2022-06-19 22:29:08 +02:00
microvm.mem = 4096;
c3d2 = {
isInHq = false;
hq.statistics.enable = true;
};
system.stateVersion = "22.05";
2021-10-07 23:00:50 +02:00
networking.hostName = "sdrweb";
# http https
networking.firewall.allowedTCPPorts = [ 80 443 ];
2021-10-07 23:00:50 +02:00
services.nginx = {
enable = true;
virtualHosts."sdr.hq.c3d2.de" = {
default = true;
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:8073";
proxyWebsockets = true;
};
};
2021-10-13 22:53:27 +02:00
virtualHosts."adsb.hq.c3d2.de" = {
forceSSL = true;
enableACME = true;
2022-09-26 23:47:36 +02:00
root = pkgs.runCommand "adsb-map" {} ''
2021-10-13 22:53:27 +02:00
mkdir $out
2021-10-13 22:55:21 +02:00
cp ${./adsb.html} $out/index.html
2021-10-13 23:44:24 +02:00
cp ${./airplane.svg} $out/airplane.svg
2021-10-13 22:53:27 +02:00
'';
extraConfig = ''
index index.html;
charset utf-8;
'';
locations."/data.json" = {
proxyPass = "http://${config.c3d2.hosts.radiobert.ip4}:8080/data.json";
2021-10-13 22:53:27 +02:00
};
};
2021-10-07 23:00:50 +02:00
};
services.openwebrx.enable = true;
services.collectd.plugins = {
curl_json = ''
<URL "http://localhost:8073/metrics.json">
Plugin "openwebrx_decodes"
<Key "wsjt/decodes/*/*/count">
Type "counter"
</Key>
<Key "aprs/decodes/*/*/*/count">
Type "counter"
</Key>
<Key "js8call/decodes/*/*/count">
Type "counter"
</Key>
<Key "decoding/queue/*/count">
Type "counter"
</Key>
<Key "decoding/queue/length">
Type "gauge"
</Key>
<Key "pskreporter/*/count">
Type "gauge"
</Key>
<Key "wsprnet/*/count">
Type "gauge"
</Key>
<Key "openwebrx/users">
Type "gauge"
</Key>
</URL>
'';
};
2021-10-30 02:02:08 +02:00
services.heliwatch = {
enable = true;
2021-10-31 19:00:03 +01:00
inherit (pkgs.mucbot) jid;
inherit (pkgs.mucbot) password;
2021-10-30 02:02:08 +02:00
muc = "luftraum@chat.c3d2.de/Hubschraubereinsatz";
};
2021-10-07 23:00:50 +02:00
# noXlibs breaks cairo:
environment.noXlibs = false;
}