16 lines
531 B
Nix
16 lines
531 B
Nix
{ lib, entities, ... }:
|
|
|
|
let
|
|
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}";
|
|
getHostRealm = hostname: (getHostDomain hostname).gssapi-realm;
|
|
getHostFqdn = hostname:
|
|
let hostDomain = entities.hosts."${hostname}".domain;
|
|
in "${hostname}.${hostDomain}";
|
|
|
|
in { inherit getHostSite getHostDomain getHostRealm getHostFqdn; }
|