From 454566755bd9b92da7f84631c4a87f35a4484dc9 Mon Sep 17 00:00:00 2001 From: Astro Date: Sat, 27 Mar 2021 01:32:51 +0100 Subject: [PATCH] legacy: add forceVeth hack for unrelated problem --- nix/lib/config/legacy.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nix/lib/config/legacy.nix b/nix/lib/config/legacy.nix index 1b12a8d..479c7dc 100644 --- a/nix/lib/config/legacy.nix +++ b/nix/lib/config/legacy.nix @@ -10,6 +10,12 @@ let then result // { "${to}" = attrset.${name}; } else result // { "${name}" = attrset.${name}; } ) {} (builtins.attrNames attrset); + + # HACK: `type = "phys"` works but once an LXC container is stopped + # the VLAN interface is not moved back. + forceVeth = interface: interface // { + type = "veth"; + }; in { options.salt-pillar = lib.mkOption {}; @@ -50,8 +56,9 @@ in role = "container"; location = mainServer; interfaces = - builtins.mapAttrs (_: + builtins.mapAttrs (_: interface: renameAttr "gw" "gw4" + (forceVeth interface) ) container.interfaces; ospf = let