diff --git a/default.nix b/default.nix index fff8135..6621209 100644 --- a/default.nix +++ b/default.nix @@ -125,5 +125,7 @@ let dummy = callPackage ./bsc/dummy/default.nix { }; + chroot = callPackage ./test/chroot.nix {}; + }; in pkgs // self diff --git a/test/chroot.nix b/test/chroot.nix new file mode 100644 index 0000000..e15fe73 --- /dev/null +++ b/test/chroot.nix @@ -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 + ''; +}