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