Fix flake update (#11)
diff-tag / dix (push) Successful in 6m33s
flake-check / flake-check (push) Successful in 59s
lint / lint (push) Successful in 1m47s

Co-authored-by: flowey <floweydev@gmail.com>
Co-authored-by: gitea-actions[bot] <gitea-actions@noreply.local>
Reviewed-on: #11
This commit was merged in pull request #11.
This commit is contained in:
2026-09-22 21:44:25 +00:00
co-authored by flowey gitea-actions[bot]
parent 8551b8ad90
commit d9b4bab1f8
10 changed files with 329 additions and 296 deletions
+44 -1
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 = [
@@ -1269,7 +1306,7 @@ rec {
# containers don't forward journal to console by default
containers = lib.genAttrs nspawnNames (_: {
timeoutStartSec = "10min";
config.services.journald.extraConfig = "ForwardToConsole=yes";
config.services.journald.settings.Journal.ForwardToConsole = "yes";
});
# a test VM has neither the memory to hand out nor the cores to divide.
@@ -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"}"