anchor.diff:          fi
         fi
   
  -      ${if cfg . "extraVeths" or null != null then
  -        ''extraFlags+=" ${concatStringsSep " " (mapAttrsToList nspawnExtraVethArgs cfg . "extraVeths" or {})}"''
  -        else
  -          ''# No extra veth pairs to create''
  -      }
  +      extraFlags+=" ${concatStringsSep " " (mapAttrsToList nspawnExtraVethArgs cfg.extraVeths)}"
   
         for iface in $INTERFACES; do
           extraFlags+=" --network-interface=$iface"
  
positive.code:       ${concatStringsSep "\n" (
          mapAttrsToList (name: cfg:
            ''ip link del dev ${name} 2> /dev/null || true ''
          ) cfg . "extraVeths" or {}
        )}
     ''
      );
    postStartScript = (cfg:
      let
        ipcall = (cfg: ipcmd: variable: attribute:
          if cfg . attribute or null == null then
            ''
              if [ -n "${variable}" ]; then
                ${ipcmd} add ${variable} dev $ifaceHost
              fi
            ''
          else
            ''${ipcmd} add ${cfg . attribute} dev $ifaceHost''
          );
        renderExtraVeth = (name: cfg:
          if cfg . "hostBridge" or null != null then
            ''
              # Add ${name} to bridge ${cfg.hostBridge}
              ip link set dev ${name} master ${cfg.hostBridge} up
            ''
          else
            ''
            # Set IPs and routes for ${name}
            ${optionalString (cfg . "hostAddress" or null != null) ''
              ip addr add ${cfg . "hostAddress"} dev ${name}
            ''}
            ${optionalString (cfg . "hostAddress6" or null != null) ''
              ip -6 addr add ${cfg . "hostAddress6"} dev ${name}
            ''}
            ${optionalString (cfg . "localAddress" or null != null) ''
              ip route add ${cfg . "localAddress"} dev ${name}
            ''}
            ${optionalString (cfg . "localAddress6" or null != null) ''
              ip -6 route add ${cfg . "localAddress6"} dev ${name}
            ''}
            ''
          );
      in
        ''
          if [ "$PRIVATE_NETWORK" = 1 ]; then
  
negative.code:         ''
          echo "Bringing ${name} up"
          ip link set dev ${name} up
          ${optionalString (cfg.localAddress != null) ''
            echo "Setting ip for ${name}"
            ip addr add ${cfg.localAddress} dev ${name}
          ''}
          ${optionalString (cfg.localAddress6 != null) ''
            echo "Setting ip6 for ${name}"
            ip -6 addr add ${cfg.localAddress6} dev ${name}
          ''}
          ${optionalString (cfg.hostAddress != null) ''
            echo "Setting route to host for ${name}"
            ip route add ${cfg.hostAddress} dev ${name}
          ''}
          ${optionalString (cfg.hostAddress6 != null) ''
            echo "Setting route6 to host for ${name}"
            ip -6 route add ${cfg.hostAddress6} dev ${name}
          ''}
          ''
          );
  