forked from c3d2/nix-config
93 lines
2.2 KiB
Nix
93 lines
2.2 KiB
Nix
{ hostRegistry, config, pkgs, ... }:
|
|
{
|
|
c3d2 = {
|
|
isInHq = false;
|
|
hq.statistics.enable = true;
|
|
};
|
|
|
|
networking.hostName = "sdrweb";
|
|
networking.useNetworkd = true;
|
|
networking.interfaces.eth0.ipv4.addresses = [{
|
|
address = hostRegistry.hosts."${config.networking.hostName}".ip4;
|
|
prefixLength = 26;
|
|
}];
|
|
networking.defaultGateway = "172.20.73.1";
|
|
|
|
# http https
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
|
|
|
services.nginx = {
|
|
enable = true;
|
|
recommendedProxySettings = true;
|
|
virtualHosts."sdr.hq.c3d2.de" = {
|
|
default = true;
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
locations."/" = {
|
|
proxyPass = "http://localhost:8073";
|
|
proxyWebsockets = true;
|
|
};
|
|
};
|
|
virtualHosts."adsb.hq.c3d2.de" = {
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
root = pkgs.runCommandNoCC "adsb-map" {} ''
|
|
mkdir $out
|
|
cp ${./adsb.html} $out/index.html
|
|
cp ${./airplane.svg} $out/airplane.svg
|
|
'';
|
|
extraConfig = ''
|
|
index index.html;
|
|
charset utf-8;
|
|
'';
|
|
locations."/data.json" = {
|
|
proxyPass = "http://${hostRegistry.hosts.radiobert.ip4}:8080/data.json";
|
|
};
|
|
};
|
|
};
|
|
|
|
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>
|
|
'';
|
|
};
|
|
|
|
services.heliwatch = {
|
|
enable = true;
|
|
inherit (pkgs.mucbot) jid;
|
|
inherit (pkgs.mucbot) password;
|
|
muc = "luftraum@chat.c3d2.de/Hubschraubereinsatz";
|
|
};
|
|
|
|
# noXlibs breaks cairo:
|
|
environment.noXlibs = false;
|
|
}
|