@@ -52,6 +52,14 @@ let
5252 gnutar gzip bzip2 xz glibcLocales
5353 ];
5454
55+ etcProfile = nixpkgs.writeText "profile" ''
56+ export PS1='${name}-chrootenv:\u@\h:\w\$ '
57+ export LOCALE_ARCHIVE='/usr/lib${if isMultiBuild then "64" else ""}/locale/locale-archive'
58+ export LD_LIBRARY_PATH=/run/opengl-driver/lib:/run/opengl-driver-32/lib:/lib:/lib64
59+ export PATH='/usr/bin:/usr/sbin'
60+ ${profile}
61+ '';
62+
5563 # Compose /etc for the chroot environment
5664 etcPkg = nixpkgs.stdenv.mkDerivation {
5765 name = "${name}-chrootenv-etc";
@@ -60,13 +68,7 @@ let
6068 cd $out/etc
6169
6270 # environment variables
63− cat >> profile <<EOF
64− export PS1='${name}-chrootenv:\u@\h:\w\$ '
65− export LOCALE_ARCHIVE='/usr/lib${if isMultiBuild then "64" else ""}/locale/locale-archive'
66− export LD_LIBRARY_PATH=/run/opengl-driver/lib:/run/opengl-driver-32/lib:/lib:/lib64
67− export PATH='/usr/bin:/usr/sbin'
68− ${profile}
69− EOF
71+ ln -s ${etcProfile} profile
7072
7173 # compatibility with NixOS
7274 ln -s /host-etc/static static