meow
diff-pr / dix (pull_request) Successful in 38m21s
flake-check / flake-check (pull_request) Successful in 9m14s
lint / lint (pull_request) Successful in 1m48s

This commit is contained in:
flowey
2026-09-22 15:53:42 -05:00
parent 83cd240c4c
commit bea6496491
6 changed files with 269 additions and 241 deletions
+43
View File
@@ -1223,6 +1223,43 @@ rec {
) (lib.attrValues autoStartTestContainers)
);
exposedTcp = lib.mapAttrs (_: c: c.ports or [ ]) autoStartTestContainers;
hostAccessTcp = lib.filterAttrs (_: v: v != [ ]) (
lib.mapAttrs (
_: c: lib.concatMap (a: if a.to == "@host" then a.tcp or [ ] else [ ]) c.access
) autoStartTestContainers
);
pyForwardTcp = lib.concatStringsSep ", " (
lib.concatMap (
c:
map (
p:
let
np = normalizePort p;
in
"(${toString np.host}, \"${c.name}\", ${toString np.container})"
) c.hostPorts
) (lib.attrValues autoStartTestContainers)
);
nginxBackendPorts = lib.mapAttrs (_: c: c.miscProperties.nginx.port) (
lib.filterAttrs (
_: c: c.miscProperties ? nginx && c.miscProperties.nginx ? port
) autoStartTestContainers
);
nginxDomainMap = lib.listToAttrs (
lib.concatMap (
c:
lib.optional (c.miscProperties ? nginx && c.miscProperties.nginx ? domain) {
name = c.miscProperties.nginx.domain;
value = c.name;
}
) (lib.attrValues autoStartTestContainers)
);
bin = lib.getExe';
testTools = [
@@ -1330,6 +1367,12 @@ rec {
# (src, to, tcp ports, udp ports); `to` may be "@host" or "@internet"
EDGES = [${pyEdges}]
EXPOSED_TCP = ${pyDict pyInts exposedTcp}
HOST_ACCESS_TCP = ${pyDict pyInts hostAccessTcp}
FORWARD_TCP = [${pyForwardTcp}]
NGINX_BACKENDS = ${pyDict toString nginxBackendPorts}
NGINX_DOMAINS = ${pyDict pyStr nginxDomainMap}
NSENTER = "${bin pkgs.util-linux "nsenter"}"
CURL = "${bin pkgs.curl "curl"}"
IP = "${bin pkgs.iproute2 "ip"}"