Skip to content

Commit

Permalink
Finish the lib.foldAttrs logic
Browse files Browse the repository at this point in the history
  • Loading branch information
antifuchs committed Aug 29, 2023
1 parent b06174e commit 5533518
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,13 @@ in {
// (
# systemd unit of the container we're sidecar-ing to:
# Ensure that the sidecar is up when the "main" container is up.
lib.foldAttrs (lib.mapAttrsToList (name: sidecar: let
lib.foldAttrs (item: acc: {unitConfig.Upholds = acc.unitConfig.Upholds ++ [item];})
{unitConfig.Upholds = [];}
(lib.mapAttrsToList (name: sidecar: let
fromServiceName = "${config.virtualisation.oci-containers.backend}-${sidecar.forContainer}";
toServiceName = "${config.virtualisation.oci-containers.backend}-${name}";
in {
"${fromServiceName}".unitConfig.Upholds = [toServiceName];
"${fromServiceName}" = toServiceName;
})
config.virtualisation.oci-sidecars.tsnsrv.containers)
);
Expand Down

0 comments on commit 5533518

Please sign in to comment.