containers: deny networkmanager from managing the ve-* and vb-* NICs

Without this, when you've enabled networkmanager and start a
nixos-container the container will briefly have its specified IP
address but then networkmanager starts managing it causing the IP
address to be dropped.

Changed files
+5
nixos
modules
virtualisation
+5
nixos/modules/virtualisation/containers.nix
···
networking.dhcpcd.denyInterfaces = [ "ve-*" "vb-*" ];
+
services.udev.extraRules = optionalString config.networking.networkmanager.enable ''
+
# Don't manage interfaces created by nixos-container.
+
ENV{INTERFACE}=="v[e,b]-*", ENV{NM_UNMANAGED}="1"
+
'';
+
environment.systemPackages = [ pkgs.nixos-container ];
});
}