feat(reverse-proxy): collect fleet routes
This commit is contained in:
@@ -16,6 +16,15 @@ let
|
||||
serviceIdentityRegistry = import ./service-identities.nix { inherit lib; };
|
||||
reverseProxyRoutes = import ./reverse-proxy-routes.nix { inherit lib; };
|
||||
|
||||
collectReverseProxyRoutes =
|
||||
hosts:
|
||||
lib.concatMapAttrs (
|
||||
hostName: host:
|
||||
lib.mapAttrs' (
|
||||
routeName: route: lib.nameValuePair "${hostName}-${routeName}" route
|
||||
) host.config.modules.reverse-proxy.routes
|
||||
) hosts;
|
||||
|
||||
collectNixFiles =
|
||||
dir:
|
||||
flatten (
|
||||
@@ -34,8 +43,9 @@ let
|
||||
);
|
||||
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
inherit inputs self;
|
||||
my = self.lib;
|
||||
reverseProxyFleetRoutes = self.lib.collectReverseProxyRoutes self.nixosConfigurations;
|
||||
};
|
||||
|
||||
bridgeName = id: "br-vlan${toString id}";
|
||||
@@ -84,6 +94,7 @@ in
|
||||
mkHost
|
||||
mkHosts
|
||||
bridgeName
|
||||
collectReverseProxyRoutes
|
||||
reverseProxyRoutes
|
||||
;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user