NixOS/nixpkgs — pull request #4007 by hrdinka (2014-09-09 10:20:24+00:00)
Title: build-fhs-chrootenv: bind mount chroots /tmp to hosts /tmp

@svanderburg here is the /tmp related, rebased & checked change to build-fhs-chrootenv as mentioned in #2355

The patch handles how /tmp is handled in build-fhs-chrootenv. Till now it just created a tmp subdirectory within /run. /run lies in memory therefore the chroots /tmp will reside there as well, this triggers two problems 1) the hosts memory is limited and this will also limit the /tmp size of the chroot (this is very bad for example graphical applications) 2) you ram will get polluted leaving you with less bang for your apps.
With the patch applied it will create a directory within the hosts /tmp and will then mount the chroot's /tmp to this newly created directory. So the chroot's /tmp will use the same capabilities and optimizations as the host's does.