about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorRob Vermaas <rob.vermaas@gmail.com>2011-11-21T15·19+0000
committerRob Vermaas <rob.vermaas@gmail.com>2011-11-21T15·19+0000
commit4e1ea17052b4cc2445bc2ece2136f248112b4e45 (patch)
tree854f434275b8771538c0cc6c0fe35b9fecf0220c /src/libstore
parent4de3e2a0db8d043324e9799ada181f7e73356908 (diff)
nix: add /etc/hosts with localhost entry to chroot builds.
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index d12f41d66941..171c08913255 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1650,6 +1650,9 @@ void DerivationGoal::startBuilder()
             (format("nixbld:!:%1%:\n")
                 % (buildUser.enabled() ? buildUser.getGID() : getgid())).str());
 
+        /* Create /etc/hosts with localhost entry. */
+        writeFile(chrootRootDir + "/etc/hosts", "127.0.0.1 localhost\n");
+
         /* Bind-mount a user-configurable set of directories from the
            host file system.  The `/dev/pts' directory must be mounted
            separately so that newly-created pseudo-terminals show