fix foldl
This commit is contained in:
@@ -160,14 +160,17 @@ 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) {
|
{
|
||||||
serviceConfig = {
|
name = (serviceName pod service);
|
||||||
Restart = lib.mkOverride 500 "always";
|
value = {
|
||||||
|
serviceConfig = {
|
||||||
|
Restart = lib.mkOverride 500 "always";
|
||||||
|
};
|
||||||
|
after = dependencies;
|
||||||
|
requires = dependencies;
|
||||||
|
partOf = [ (podRef pod) ];
|
||||||
|
wantedBy = [ (podRef pod) ];
|
||||||
};
|
};
|
||||||
after = dependencies;
|
|
||||||
requires = dependencies;
|
|
||||||
partOf = [ (podRef pod) ];
|
|
||||||
wantedBy = [ (podRef pod) ];
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
pod.services)
|
pod.services)
|
||||||
@@ -189,36 +192,39 @@ 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: {
|
||||||
image = service.image;
|
name = serviceName pod service;
|
||||||
volumes = service.volumes;
|
value = {
|
||||||
log-driver = "journal";
|
image = service.image;
|
||||||
ports = service.ports;
|
volumes = service.volumes;
|
||||||
environment = service.environment;
|
log-driver = "journal";
|
||||||
environmentFiles = service.environmentFiles;
|
ports = service.ports;
|
||||||
cmd = service.cmd;
|
environment = service.environment;
|
||||||
extraOptions = [
|
environmentFiles = service.environmentFiles;
|
||||||
"--network-alias=${service.alias or service.name}"
|
cmd = service.cmd;
|
||||||
"--network=${networkName pod}"
|
extraOptions = [
|
||||||
] ++ (if (service.healthCheck != null) then [
|
"--network-alias=${service.alias or service.name}"
|
||||||
"--health-cmd=${
|
"--network=${networkName pod}"
|
||||||
|
] ++ (if (service.healthCheck != null) then [
|
||||||
|
"--health-cmd=${
|
||||||
if (builtins.isList service.healthCheck.test)
|
if (builtins.isList service.healthCheck.test)
|
||||||
then builtins.toJSON service.healthCheck.test
|
then builtins.toJSON service.healthCheck.test
|
||||||
else service.healthCheck.test
|
else service.healthCheck.test
|
||||||
}"
|
}"
|
||||||
"--health-interval=${service.healthCheck.interval}"
|
"--health-interval=${service.healthCheck.interval}"
|
||||||
"--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);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user