lib/config/options: make isRouter depend on having an ipv4 address in core

prevents server2 from becoming a router
This commit is contained in:
Astro 2021-04-10 14:44:44 +02:00
parent 6eb8a1d24f
commit 010a5cfb97
1 changed files with 5 additions and 1 deletions

View File

@ -155,7 +155,11 @@ let
};
isRouter = mkOption {
type = types.bool;
default = config.site.hosts.${name}.interfaces ? core;
# isRouter = Part of the core network?
default =
config.site.hosts.${name}.interfaces ? core &&
config.site.net.core.hosts4 ? name;
description = "Should this host route?";
};
forwardPorts = mkOption {
type = with types; listOf (submodule { options = {