Add getSiteNetwork and getSite*PrefixLength

This commit is contained in:
niten 2023-11-15 12:39:47 -08:00
parent 85d0cc2990
commit 1bfc4405b2

11
lib.nix
View File

@ -57,8 +57,17 @@ let
getHostGatewayV6 = hostname:
getSiteGatewayV6 entities.hosts."${hostname}".site;
getSiteNetwork = siteName: entities.sites."${siteName}".network;
getSiteV4PrefixLength = siteName:
toInt (elemAt (splitString "/" (getSiteNetwork siteName)));
getSiteV6PrefixLength = siteName:
abort "not implemented: getSiteV6PrefixLength";
in {
inherit getHostSite getHostDomain getHostRealm getHostFqdn getHostIpv4
getHostIpv6 getHostIps getDomainPostgresqlServer getSiteHosts getDomainHosts
getSiteGatewayV4 getHostGatewayV4 getSiteGatewayV6 getHostGatewayV6;
getSiteGatewayV4 getHostGatewayV4 getSiteGatewayV6 getHostGatewayV6
getSiteV4PrefixLength getSiteV6PrefixLength;
}