20 lines
502 B
Nix
20 lines
502 B
Nix
{ lib }:
|
|
let
|
|
endpointFields = address: { inherit address; };
|
|
|
|
collectFleetEndpoints = hosts:
|
|
lib.concatMapAttrs (
|
|
hostName: host:
|
|
lib.mapAttrs' (
|
|
entryName: address:
|
|
let
|
|
endpointName = if entryName == "self" then hostName else "${hostName}-${entryName}";
|
|
in
|
|
lib.nameValuePair endpointName (endpointFields address)
|
|
) (host.config.registry.address.${hostName} or { })
|
|
) hosts;
|
|
in
|
|
{
|
|
inherit collectFleetEndpoints endpointFields;
|
|
}
|