sync-containers3: bind to bridge after startup

This commit is contained in:
lassulus 2023-11-25 12:42:10 +01:00
parent 015ef28416
commit 334378bc57

View File

@ -246,9 +246,11 @@ in {
}; }
{ "container@${ctr.name}" = lib.mkIf ctr.runContainer {
serviceConfig = {
ExecStop = pkgs.writers.writeDash "remove_interface" ''
${pkgs.iproute2}/bin/ip link del vb-${ctr.name}
'';
ExecStartPost = [
(pkgs.writers.writeDash "bind-to-bridge" ''
${pkgs.iproute2}/bin/ip link set "vb-$INSTANCE" master ctr0
'')
];
};
}; }
]) (lib.attrValues cfg.containers)));