depot/cluster/lib/mesh.nix

18 lines
469 B
Nix
Raw Normal View History

2024-07-04 05:06:20 +03:00
{ config, lib, ... }:
{
hostLinks = lib.pipe config.services [
(lib.filterAttrs (_: svc: svc.meshLinks != {}))
2024-08-23 02:06:38 +03:00
(lib.mapAttrsToList (svcName: svc:
lib.mapAttrsToList (groupName: links:
lib.genAttrs svc.nodes.${groupName} (hostName: lib.mapAttrs (_: cfg: { ... }: {
imports = [ cfg.link ];
ipv4 = config.vars.mesh.${hostName}.meshIp;
}) links)
) svc.meshLinks
))
2024-07-04 05:06:20 +03:00
(map lib.mkMerge)
lib.mkMerge
];
}