diff options
author | Bas van Dijk <v.dijk.bas@gmail.com> | 2017-11-21 08:41:41 +0100 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2017-12-12 18:22:15 +0100 |
commit | 5572de75a06ad051eeee8e6e74aa736ed0a58465 (patch) | |
tree | 622d8825b513bf1cfc225eace3e0cca7720b2fec | |
parent | 875eaf0821e3542028d105d222a49274bfcfcfdd (diff) | |
download | nixlib-5572de75a06ad051eeee8e6e74aa736ed0a58465.tar nixlib-5572de75a06ad051eeee8e6e74aa736ed0a58465.tar.gz nixlib-5572de75a06ad051eeee8e6e74aa736ed0a58465.tar.bz2 nixlib-5572de75a06ad051eeee8e6e74aa736ed0a58465.tar.lz nixlib-5572de75a06ad051eeee8e6e74aa736ed0a58465.tar.xz nixlib-5572de75a06ad051eeee8e6e74aa736ed0a58465.tar.zst nixlib-5572de75a06ad051eeee8e6e74aa736ed0a58465.zip |
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.
-rw-r--r-- | nixos/modules/virtualisation/containers.nix | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nixos/modules/virtualisation/containers.nix b/nixos/modules/virtualisation/containers.nix index e68bfd860601..12dbd54b306a 100644 --- a/nixos/modules/virtualisation/containers.nix +++ b/nixos/modules/virtualisation/containers.nix @@ -726,6 +726,11 @@ in 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 ]; }); } |