From a8523c4b4eac2f5c970af7ffc8a7afe5b81c37de Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Tue, 16 Jun 2020 15:39:11 +0200 Subject: [PATCH] Add sandbox build test --- default.nix | 2 ++ test/chroot.nix | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 test/chroot.nix 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 + ''; +}