l sync-containers3: remove interface on container shutdown

This commit is contained in:
lassulus 2023-01-18 20:06:48 +01:00
parent 501330a87c
commit 4d64e17557

View File

@ -235,6 +235,13 @@ in {
'';
};
}; }
{ "container@${ctr.name}" = lib.mkIf ctr.runContainer {
serviceConfig = {
ExecStop = pkgs.writers.writeDash "remove_interface" ''
${pkgs.iproute2}/bin/ip link del vb-${ctr.name}
'';
};
}; }
]) (lib.attrValues cfg.containers)));
systemd.timers = lib.mapAttrs' (n: ctr: lib.nameValuePair "${ctr.name}_syncer" {