From e620be97fe212b43ee42865dd4d3c8bba7f26fa9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 15 Aug 2014 04:04:28 +0200 Subject: [PATCH] Containers: Set up /etc/resolv.conf Systemd-nspawn is supposed to do this, but doesn't if any of the --network-* flags are used. --- nixos/modules/virtualisation/containers.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/virtualisation/containers.nix b/nixos/modules/virtualisation/containers.nix index d0d04d9a1e5d..7f545a9d3031 100644 --- a/nixos/modules/virtualisation/containers.nix +++ b/nixos/modules/virtualisation/containers.nix @@ -187,6 +187,8 @@ in "/nix/var/nix/profiles/per-container/$INSTANCE" \ "/nix/var/nix/gcroots/per-container/$INSTANCE" + cp -f /etc/resolv.conf "$root/etc/resolv.conf" + if [ "$PRIVATE_NETWORK" = 1 ]; then extraFlags+=" --network-veth" fi