entities/lib.nix

16 lines
531 B
Nix
Raw Normal View History

2023-01-17 13:30:45 -08:00
{ 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}";
2023-01-17 13:30:45 -08:00
getHostRealm = hostname: (getHostDomain hostname).gssapi-realm;
getHostFqdn = hostname:
let hostDomain = entities.hosts."${hostname}".domain;
in "${hostname}.${hostDomain}";
2023-01-17 13:30:45 -08:00
in { inherit getHostSite getHostDomain getHostRealm getHostFqdn; }