mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 21:33:03 +03:00
23 lines
552 B
Bash
23 lines
552 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,tmp}
|
|
|
|
# Remove symlinks to the software that should be part of the chroot system profile
|
|
for i in @chrootEnv@/*
|
|
do
|
|
if [ "$i" != "@chrootEnv@/etc" ] && [ "$i" != "@chrootEnv@/var" ]
|
|
then
|
|
rm $chrootenvDest/$(basename $i)
|
|
fi
|
|
done
|
|
|
|
# Remove the remaining folders
|
|
rm -Rf $chrootenvDest/{etc,root}
|
|
rm -Rf /tmp/chrootenv-@name@
|
|
|
|
# Remove the chroot environment folder
|
|
rmdir $chrootenvDest
|