summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2023-01-18 20:06:48 +0100
committerlassulus <lassulus@lassul.us>2023-01-18 20:06:48 +0100
commit4d64e1755794cd8364afce6dbcbea72c04466dfa (patch)
treec2cd72a5d12be35306b32aa012e8de1baa3cd013
parent501330a87c362afa8bd325711f8f3346795be3b0 (diff)
l sync-containers3: remove interface on container shutdown
-rw-r--r--lass/3modules/sync-containers3.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/lass/3modules/sync-containers3.nix b/lass/3modules/sync-containers3.nix
index 03eb14e66..7966f4097 100644
--- a/lass/3modules/sync-containers3.nix
+++ b/lass/3modules/sync-containers3.nix
@@ -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" {