This repository has been archived on 2026-08-30. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
dotfiles/lib/network-endpoints.nix

21 lines
606 B
Nix

{ lib }:
# TODO: Remove this compatibility bridge when route backend resolution reads registry.address directly.
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;
}