mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 16:11:58 +00:00
23 lines
530 B
Bash
23 lines
530 B
Bash
#! @shell@ -e
|
|
|
|
chrootenvDest=/run/chrootenv/@name@
|
|
|
|
# Create some mount points for stuff that must be bind mounted
|
|
mkdir -p $chrootenvDest/{nix/store,dev,proc,sys,host-etc,host-tmp,home,var,run}
|
|
|
|
# Symlink the software that should be part of the chroot system profile
|
|
for i in @chrootEnv@/*
|
|
do
|
|
if [ "$i" != "@chrootEnv@/var" ]
|
|
then
|
|
ln -s "$i" "$chrootenvDest"
|
|
fi
|
|
done
|
|
|
|
# Create root folder
|
|
mkdir $chrootenvDest/root
|
|
|
|
# Create tmp folder
|
|
mkdir -m1777 $chrootenvDest/tmp
|
|
mkdir -m1777 -p /tmp/chrootenv-@name@
|