nebula: Assert routability of lighthouses

This commit is contained in:
SebastianStork 2025-12-25 20:00:44 +01:00
parent d58da5ce7d
commit de16ca49e8
Signed by: SebastianStork
SSH key fingerprint: SHA256:iEM011ogNMG1q8+U500adGu/9rpPuZ2KnFtbdLeqTiI

View file

@ -55,6 +55,11 @@ in
config = lib.mkIf cfg.enable {
meta.ports.udp = lib.optional (cfg.routablePort != null) cfg.routablePort;
assertions = lib.singleton {
assertion = cfg.isLighthouse -> cfg.routableAddress != null;
message = "'${hostname}' is a Nebula lighthouse, but routableAddress is not set. Lighthouses must be publicly reachable.";
};
sops.secrets."nebula/host-key" = {
owner = config.users.users.nebula-main.name;
restartUnits = [ "nebula@main.service" ];