fix foldl

This commit is contained in:
Joakim Repomaa
2024-07-03 11:17:00 +03:00
parent a5da268626
commit 02b23d63ac

View File

@@ -160,7 +160,9 @@ in
(lib.map (name: volumeServiceRef pod.name name) (namedVolumes service)) ++
(networkServiceRef pod);
in
lib.nameValuePair (serviceName pod service) {
{
name = (serviceName pod service);
value = {
serviceConfig = {
Restart = lib.mkOverride 500 "always";
};
@@ -168,6 +170,7 @@ in
requires = dependencies;
partOf = [ (podRef pod) ];
wantedBy = [ (podRef pod) ];
};
}
)
pod.services)
@@ -189,12 +192,14 @@ in
pod.services)))
])
{ }
cfg;
(lib.attrValues cfg);
virtualisation.oci-containers.containers = lib.foldl
(containers: pod: containers // (
lib.mapAttrs' (_: service:
lib.nameValuePair (serviceName pod service) {
lib.mapAttrs'
(_: service: {
name = serviceName pod service;
value = {
image = service.image;
volumes = service.volumes;
log-driver = "journal";
@@ -215,10 +220,11 @@ in
"--health-startup-interval=${service.healthCheck.startupInterval}"
"--health-start-period=${service.healthCheck.startPeriod}"
] else [ ]);
}
)
};
})
pod.services
))
{ }
cfg;
(lib.attrValues cfg);
};
}