From 61cc624a3077672916cfa35a1e2861862b688d9e Mon Sep 17 00:00:00 2001 From: Markus Schmidl Date: Sat, 25 Nov 2023 23:08:05 +0100 Subject: [PATCH] move more traffic-stop-box config to registry --- modules/traffic-stop-box/radio-config.nix | 8 ++------ .../0 => registry/traffic-stop-box}/config_0.json | 0 .../1 => registry/traffic-stop-box}/config_1.json | 0 .../10 => registry/traffic-stop-box}/config_10.json | 0 .../2 => registry/traffic-stop-box}/config_2.json | 0 .../3 => registry/traffic-stop-box}/config_3.json | 0 .../4 => registry/traffic-stop-box}/config_4.json | 0 .../6 => registry/traffic-stop-box}/config_6.json | 0 .../7 => registry/traffic-stop-box}/config_7.json | 0 .../8 => registry/traffic-stop-box}/config_8.json | 0 .../9 => registry/traffic-stop-box}/config_9.json | 0 registry/traffic-stop-box/default.nix | 10 ++++++++++ 12 files changed, 12 insertions(+), 6 deletions(-) rename {hosts/traffic-stop-box/0 => registry/traffic-stop-box}/config_0.json (100%) rename {hosts/traffic-stop-box/1 => registry/traffic-stop-box}/config_1.json (100%) rename {hosts/traffic-stop-box/10 => registry/traffic-stop-box}/config_10.json (100%) rename {hosts/traffic-stop-box/2 => registry/traffic-stop-box}/config_2.json (100%) rename {hosts/traffic-stop-box/3 => registry/traffic-stop-box}/config_3.json (100%) rename {hosts/traffic-stop-box/4 => registry/traffic-stop-box}/config_4.json (100%) rename {hosts/traffic-stop-box/6 => registry/traffic-stop-box}/config_6.json (100%) rename {hosts/traffic-stop-box/7 => registry/traffic-stop-box}/config_7.json (100%) rename {hosts/traffic-stop-box/8 => registry/traffic-stop-box}/config_8.json (100%) rename {hosts/traffic-stop-box/9 => registry/traffic-stop-box}/config_9.json (100%) diff --git a/modules/traffic-stop-box/radio-config.nix b/modules/traffic-stop-box/radio-config.nix index 44fcccf..a993e91 100644 --- a/modules/traffic-stop-box/radio-config.nix +++ b/modules/traffic-stop-box/radio-config.nix @@ -1,8 +1,4 @@ -{ config, lib, self, registry, ... }: -let - - file = with config.deployment-TLMS; "${self}/hosts/traffic-stop-box/${toString systemNumber}/config_${toString systemNumber}.json"; -in +{ config, lib, registry, ... }: { TLMS.gnuradio = { enable = true; @@ -11,7 +7,7 @@ in TLMS.telegramDecoder = { enable = true; server = [ "http://10.13.37.1:8080" "http://10.13.37.5:8080" "http://10.13.37.7:8080" ]; - configFile = file; + configFile = registry.telegramDecoderConfig; authTokenFile = config.sops.secrets.telegram-decoder-token.path; }; } diff --git a/hosts/traffic-stop-box/0/config_0.json b/registry/traffic-stop-box/config_0.json similarity index 100% rename from hosts/traffic-stop-box/0/config_0.json rename to registry/traffic-stop-box/config_0.json diff --git a/hosts/traffic-stop-box/1/config_1.json b/registry/traffic-stop-box/config_1.json similarity index 100% rename from hosts/traffic-stop-box/1/config_1.json rename to registry/traffic-stop-box/config_1.json diff --git a/hosts/traffic-stop-box/10/config_10.json b/registry/traffic-stop-box/config_10.json similarity index 100% rename from hosts/traffic-stop-box/10/config_10.json rename to registry/traffic-stop-box/config_10.json diff --git a/hosts/traffic-stop-box/2/config_2.json b/registry/traffic-stop-box/config_2.json similarity index 100% rename from hosts/traffic-stop-box/2/config_2.json rename to registry/traffic-stop-box/config_2.json diff --git a/hosts/traffic-stop-box/3/config_3.json b/registry/traffic-stop-box/config_3.json similarity index 100% rename from hosts/traffic-stop-box/3/config_3.json rename to registry/traffic-stop-box/config_3.json diff --git a/hosts/traffic-stop-box/4/config_4.json b/registry/traffic-stop-box/config_4.json similarity index 100% rename from hosts/traffic-stop-box/4/config_4.json rename to registry/traffic-stop-box/config_4.json diff --git a/hosts/traffic-stop-box/6/config_6.json b/registry/traffic-stop-box/config_6.json similarity index 100% rename from hosts/traffic-stop-box/6/config_6.json rename to registry/traffic-stop-box/config_6.json diff --git a/hosts/traffic-stop-box/7/config_7.json b/registry/traffic-stop-box/config_7.json similarity index 100% rename from hosts/traffic-stop-box/7/config_7.json rename to registry/traffic-stop-box/config_7.json diff --git a/hosts/traffic-stop-box/8/config_8.json b/registry/traffic-stop-box/config_8.json similarity index 100% rename from hosts/traffic-stop-box/8/config_8.json rename to registry/traffic-stop-box/config_8.json diff --git a/hosts/traffic-stop-box/9/config_9.json b/registry/traffic-stop-box/config_9.json similarity index 100% rename from hosts/traffic-stop-box/9/config_9.json rename to registry/traffic-stop-box/config_9.json diff --git a/registry/traffic-stop-box/default.nix b/registry/traffic-stop-box/default.nix index f656c0a..4e4a739 100644 --- a/registry/traffic-stop-box/default.nix +++ b/registry/traffic-stop-box/default.nix @@ -7,6 +7,7 @@ wgAddr4 = "10.13.37.100"; arch = "x86_64-linux"; monitoring = true; + telegramDecoderConfig = ./config_0.json; }; # Zentralwerk "1" = { @@ -16,18 +17,21 @@ wgAddr4 = "10.13.37.101"; arch = "x86_64-linux"; monitoring = true; + telegramDecoderConfig = ./config_1.json; }; "2" = { wireguardPublicKey = "4TUQCToGNhjsCgV9elYE/91Vd/RvMgvMXtF/1Dzlvxo="; hostName = "traffic-stop-box-2"; gnuradio = { frequency = 153850000; offset = 20000; device = ""; RF = 14; IF = 32; BB = 42; }; # chemnitz wgAddr4 = "10.13.37.102"; + telegramDecoderConfig = ./config_2.json; }; "3" = { wireguardPublicKey = "w3AT3EahW1sCK8ZsR7sDTcQj1McXYeWx7fnfQFA7i3o="; hostName = "traffic-stop-box-3"; gnuradio = { frequency = 170795000; offset = 19400; device = ""; RF = 14; IF = 32; BB = 42; }; # dresden unused wgAddr4 = "10.13.37.103"; + telegramDecoderConfig = ./config_3.json; }; # Wundstr. 9 "4" = { @@ -37,6 +41,7 @@ wgAddr4 = "10.13.37.104"; arch = "x86_64-linux"; monitoring = true; + telegramDecoderConfig = ./config_4.json; }; # number 5 is missing "6" = { @@ -44,12 +49,14 @@ hostName = "traffic-stop-box-6"; gnuradio = { frequency = 150827500; offset = 19550; device = ""; RF = 14; IF = 32; BB = 42; }; # warpzone münster wgAddr4 = "10.13.37.106"; + telegramDecoderConfig = ./config_6.json; }; "7" = { wireguardPublicKey = "sMsdY7dSjlYeIFMqjkh4pJ/ftAYXlyRuxDGbdnGLpEQ="; hostName = "traffic-stop-box-7"; gnuradio = { frequency = 150827500; offset = 19550; device = ""; RF = 14; IF = 32; BB = 42; }; # drehturm aachen wgAddr4 = "10.13.37.107"; + telegramDecoderConfig = ./config_7.json; }; # Hannover Bredero Hochhaus City "8" = { @@ -59,6 +66,7 @@ wgAddr4 = "10.13.37.108"; arch = "aarch64-linux"; monitoring = false; + telegramDecoderConfig = ./config_8.json; }; # Hannover Bredero Hochhaus Wider Area "9" = { @@ -68,11 +76,13 @@ wgAddr4 = "10.13.37.109"; arch = "aarch64-linux"; monitoring = false; + telegramDecoderConfig = ./config_9.json; }; "10" = { wireguardPublicKey = "dL9JGsBhaTOmXgGEH/N/GCHbQgVHEjBvIMaRtCsHBHw="; hostName = "traffic-stop-box-10"; gnuradio = { frequency = 153850000; offset = 20000; device = ""; RF = 14; IF = 32; BB = 42; }; # CLT wgAddr4 = "10.13.37.110"; + telegramDecoderConfig = ./config_10.json; }; }