pkgs/gateway-report: emphasize ipv6 default router
This commit is contained in:
parent
13e0aa216e
commit
2b6bb2e423
|
@ -56,15 +56,17 @@ writeText "vlan-report.md" ''
|
||||||
let
|
let
|
||||||
hostConfig = config.site.hosts.${hostName};
|
hostConfig = config.site.hosts.${hostName};
|
||||||
isDhcpDefault = hostName == netConfig.dhcp.router or null;
|
isDhcpDefault = hostName == netConfig.dhcp.router or null;
|
||||||
|
emphasize = s:
|
||||||
|
if isDhcpDefault
|
||||||
|
then "**${s}**"
|
||||||
|
else s;
|
||||||
upstream4a = upstreamAt hostConfig.ospf.allowedUpstreams 0;
|
upstream4a = upstreamAt hostConfig.ospf.allowedUpstreams 0;
|
||||||
upstream4b = upstreamAt hostConfig.ospf.allowedUpstreams 1;
|
upstream4b = upstreamAt hostConfig.ospf.allowedUpstreams 1;
|
||||||
in ''
|
in ''
|
||||||
|`${
|
|${
|
||||||
netConfig.hosts4.${hostName}
|
emphasize netConfig.hosts4.${hostName}
|
||||||
}`|${
|
}|${
|
||||||
if isDhcpDefault
|
emphasize hostName
|
||||||
then "**${hostName}**"
|
|
||||||
else hostName
|
|
||||||
}|${
|
}|${
|
||||||
upstream4a
|
upstream4a
|
||||||
}|${
|
}|${
|
||||||
|
@ -86,17 +88,24 @@ writeText "vlan-report.md" ''
|
||||||
${lib.concatMapStrings (hostName:
|
${lib.concatMapStrings (hostName:
|
||||||
let
|
let
|
||||||
hostConfig = config.site.hosts.${hostName};
|
hostConfig = config.site.hosts.${hostName};
|
||||||
|
isIpv6Router = hostName == netConfig.ipv6Router;
|
||||||
|
emphasize = s:
|
||||||
|
if isIpv6Router
|
||||||
|
then "**${s}**"
|
||||||
|
else s;
|
||||||
upstream6a = upstreamAt hostConfig.ospf.allowedUpstreams6 0;
|
upstream6a = upstreamAt hostConfig.ospf.allowedUpstreams6 0;
|
||||||
upstream6b = upstreamAt hostConfig.ospf.allowedUpstreams6 1;
|
upstream6b = upstreamAt hostConfig.ospf.allowedUpstreams6 1;
|
||||||
in ''
|
in ''
|
||||||
|${
|
|${
|
||||||
lib.concatMapStringsSep " " (ctx:
|
emphasize (
|
||||||
"`${netConfig.hosts6.${ctx}.${hostName}}`"
|
lib.concatMapStringsSep " " (ctx:
|
||||||
) (builtins.filter (ctx:
|
"`${netConfig.hosts6.${ctx}.${hostName}}`"
|
||||||
netConfig.hosts6.${ctx} ? ${hostName}
|
) (builtins.filter (ctx:
|
||||||
) (builtins.attrNames netConfig.hosts6))
|
netConfig.hosts6.${ctx} ? ${hostName}
|
||||||
|
) (builtins.attrNames netConfig.hosts6))
|
||||||
|
)
|
||||||
}|${
|
}|${
|
||||||
hostName
|
emphasize hostName
|
||||||
}|${
|
}|${
|
||||||
upstream6a
|
upstream6a
|
||||||
}|${
|
}|${
|
||||||
|
|
Loading…
Reference in New Issue