From 7629a979b42f3023a343099639f18b63bde0270b Mon Sep 17 00:00:00 2001 From: niten Date: Mon, 13 Nov 2023 18:09:11 -0800 Subject: [PATCH] More util functions --- lib.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib.nix b/lib.nix index 23593a8..cd3ca17 100644 --- a/lib.nix +++ b/lib.nix @@ -36,8 +36,13 @@ let getDomainHosts = domain: attrNames (filterAttrs (_: hostOpts: hostOpts.domain == domain) entities.hosts); + + getSiteGateway = site: entities.sites."${site-name}".gateway-v4; + + getHostGateway = hostname: (getHostSite hostname).gateway-v4; + in { inherit getHostSite getHostDomain getHostRealm getHostFqdn getHostIpv4 - getHostIpv6 getHostIps getDomainPostgresqlServer getSiteHosts - getDomainHosts; + getHostIpv6 getHostIps getDomainPostgresqlServer getSiteHosts getDomainHosts + getSiteGateway getHostGateway; }