2023-01-17 13:30:45 -08:00
|
|
|
{ lib, entities, ... }:
|
|
|
|
|
|
|
|
let
|
2023-01-17 13:42:50 -08:00
|
|
|
getHostSite = hostname:
|
|
|
|
let site-name = entities.hosts."${hostname}".site;
|
|
|
|
in entities.sites."${site-name}";
|
|
|
|
getHostDomain = hostname:
|
|
|
|
let domain-name = entities.hosts."${hostname}".domain;
|
|
|
|
in entities.domains."${domain-name}";
|
2023-01-17 13:30:45 -08:00
|
|
|
getHostRealm = hostname: (getHostDomain hostname).gssapi-realm;
|
2023-01-18 12:54:21 -08:00
|
|
|
getHostFqdn = hostname:
|
|
|
|
let hostDomain = entities.hosts."${hostname}".domain;
|
|
|
|
in "${hostname}.${hostDomain}";
|
2023-01-17 13:30:45 -08:00
|
|
|
|
2023-01-18 12:54:21 -08:00
|
|
|
in { inherit getHostSite getHostDomain getHostRealm getHostFqdn; }
|