96 lines
3 KiB
Nix
96 lines
3 KiB
Nix
|
{ cfg, lib, ... }:
|
||
|
let
|
||
|
hostPort = lib.types.submodule {
|
||
|
options = {
|
||
|
|
||
|
host = lib.options.mkOption {
|
||
|
type = lib.types.str;
|
||
|
};
|
||
|
|
||
|
port = lib.options.mkOption {
|
||
|
type = lib.types.port;
|
||
|
};
|
||
|
|
||
|
};
|
||
|
};
|
||
|
netConnector = lib.types.submodule {
|
||
|
options = {
|
||
|
protocol = lib.options.mkOption {
|
||
|
type = lib.types.enum [
|
||
|
"beast_in"
|
||
|
"beast_out"
|
||
|
"beast_reduce_out"
|
||
|
"beast_reduce_plus_out"
|
||
|
"gpsd_in"
|
||
|
"json_out"
|
||
|
"raw_in"
|
||
|
"raw_out"
|
||
|
"sbs_in"
|
||
|
"sbs_in_jaero"
|
||
|
"sbs_in_mlat"
|
||
|
"sbs_out"
|
||
|
"sbs_out_jaero"
|
||
|
"sbs_out_mlat"
|
||
|
"sbs_out_replay"
|
||
|
"uat_in"
|
||
|
"vrs_out"
|
||
|
];
|
||
|
};
|
||
|
primary = lib.options.mkOption {
|
||
|
type = hostPort;
|
||
|
};
|
||
|
silentFail = lib.options.mkOption {
|
||
|
type = lib.types.bool;
|
||
|
default = false;
|
||
|
};
|
||
|
secondary = lib.options.mkOption {
|
||
|
type = lib.types.nullOr hostPort;
|
||
|
default = null;
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
UUID = lib.types.addCheck lib.types.str (
|
||
|
uuid: (builtins.match ''^[A-F0-9a-f]{8}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f]{4}-[A-F0-9a-f]{12}$'' uuid) != null
|
||
|
);
|
||
|
in
|
||
|
{
|
||
|
adsb = lib.options.mkOption {
|
||
|
type = lib.types.submodule {
|
||
|
options = {
|
||
|
|
||
|
enable = lib.options.mkEnableOption "ADS-B";
|
||
|
|
||
|
latitude = lib.options.mkOption {
|
||
|
type = lib.types.addCheck lib.types.str (
|
||
|
lat:
|
||
|
(builtins.match ''^([+-])?[0-9]+(\.[0-9]{5,})?$'' lat) != null && (builtins.fromJSON lat) >= -90.0 && (builtins.fromJSON lat) <= 90.0
|
||
|
);
|
||
|
description = "Latitude of the receiver expressed in degrees with at least 5 decimal places. For MLAT the precise location of your antenna is required. A small error of 15m/45ft will cause issues with MLAT!";
|
||
|
};
|
||
|
|
||
|
longitude = lib.options.mkOption {
|
||
|
type = lib.types.addCheck lib.types.str (
|
||
|
lon:
|
||
|
(builtins.match ''^([+-])?[0-9]+(\.[0-9]{5,})?$'' lon) != null && (builtins.fromJSON lon) >= -180.0 && (builtins.fromJSON lon) <= 180.0
|
||
|
);
|
||
|
description = "Longitude of the receiver expressed in degrees with at least 5 decimal places. For MLAT the precise location of your antenna is required. A small error of 15m/45ft will cause issues with MLAT!";
|
||
|
};
|
||
|
|
||
|
altitude = lib.options.mkOption {
|
||
|
type = lib.types.float;
|
||
|
description = "The altitude if the receiver above sea level (in meters).";
|
||
|
};
|
||
|
|
||
|
dump1090 = import ./dump1090.nix { inherit lib; };
|
||
|
dump978 = import ./dump978.nix { inherit lib; };
|
||
|
skyaware978 = import ./skyaware978.nix { inherit lib; };
|
||
|
|
||
|
adsbexchange = import ./adsbexchange.nix { inherit cfg lib netConnector UUID; };
|
||
|
adsbfi = import ./adsbfi.nix { inherit cfg lib netConnector UUID; };
|
||
|
piaware = import ./piaware.nix { inherit lib UUID; };
|
||
|
theairtraffic = import ./theairtraffic.nix { inherit cfg lib netConnector UUID; };
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|