nix: add /etc/hosts with localhost entry to chroot builds.

This commit is contained in:
Rob Vermaas 2011-11-21 15:19:51 +00:00
parent 4de3e2a0db
commit 4e1ea17052
1 changed files with 3 additions and 0 deletions

View File

@ -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