mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 08:53:21 +00:00
22 lines
532 B
Bash
22 lines
532 B
Bash
#! @shell@ -e
|
|
|
|
chrootenvDest=/run/chrootenv/@name@
|
|
|
|
# Remove bind mount points
|
|
rmdir $chrootenvDest/{dev,nix/store,nix,proc,sys,host-etc,home,var,run}
|
|
|
|
# Remove symlinks to the software that should be part of the chroot system profile
|
|
for i in @chrootEnv@/sw/*
|
|
do
|
|
if [ "$i" != "@chrootEnv@/sw/etc" ] && [ "$i" != "@chrootEnv@/sw/var" ]
|
|
then
|
|
rm $chrootenvDest/$(basename $i)
|
|
fi
|
|
done
|
|
|
|
# Remove the remaining folders
|
|
rm -Rf $chrootenvDest/{etc,root,tmp}
|
|
|
|
# Remove the chroot environment folder
|
|
rmdir $chrootenvDest
|