diff options
author | lassulus <lassulus@lassul.us> | 2023-01-18 20:06:48 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2023-01-18 20:06:48 +0100 |
commit | 4d64e1755794cd8364afce6dbcbea72c04466dfa (patch) | |
tree | c2cd72a5d12be35306b32aa012e8de1baa3cd013 /lass/3modules | |
parent | 501330a87c362afa8bd325711f8f3346795be3b0 (diff) |
l sync-containers3: remove interface on container shutdown
Diffstat (limited to 'lass/3modules')
-rw-r--r-- | lass/3modules/sync-containers3.nix | 7 |
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" { |