Add sandbox build test

This commit is contained in:
Rodrigo Arias 2020-06-16 15:39:11 +02:00
parent 63c78f50de
commit a8523c4b4e
2 changed files with 24 additions and 0 deletions

View File

@ -125,5 +125,7 @@ let
dummy = callPackage ./bsc/dummy/default.nix {
};
chroot = callPackage ./test/chroot.nix {};
};
in pkgs // self

22
test/chroot.nix Normal file
View File

@ -0,0 +1,22 @@
{stdenv}:
stdenv.mkDerivation rec {
version = "0.0.1";
name = "chroot-checker";
src = ./chroot.nix;
dontUnpack = true;
buildPhase = ''
if [ -e /boot ]; then
echo Build is NOT under chroot
echo This is the content of / :
ls -l /
exit 1
fi
echo "OK: Build is under chroot"
'';
installPhase = ''
mkdir -p $out
'';
}