Add a test for nix using a binder subidrectory
ADD
tests/nix/ignore-outside/README.rst
+Check `start` works with nix
+----------------------------
+
+In this example we set a environment variable in the `start` script and check
+it works when using the nix build pack.

ADD
tests/nix/ignore-outside/binder/default.nix
+let
+ # Pinning nixpkgs to specific release
+ # To get sha256 use "nix-prefetch-git <url> --rev <commit>"
+ commitRev="5574b6a152b1b3ae5f93ba37c4ffd1981f62bf5a";
+ nixpkgs = builtins.fetchTarball {
+ url = "https://github.com/NixOS/nixpkgs/archive/${commitRev}.tar.gz";
+ sha256 = "1pqdddp4aiz726c7qs1dwyfzixi14shp0mbzi1jhapl9hrajfsjg";
+ };
+ pkgs = import nixpkgs { config = { allowUnfree = true; }; };
+in
+pkgs.mkShell {
+ buildInputs = with pkgs; [
+ python36Packages.notebook
+ ];
+
+ shellHook = ''
+ export NIX_PATH="nixpkgs=${nixpkgs}:."
+ '';
+}

ADD
tests/nix/ignore-outside/default.nix
+let
+ # Pinning nixpkgs to specific release
+ # To get sha256 use "nix-prefetch-git <url> --rev <commit>"
+ commitRev="5574b6a152b1b3ae5f93ba37c4ffd1981f62bf5a";
+ nixpkgs = builtins.fetchTarball {
+ url = "https://github.com/NixOS/nixpkgs/archive/${commitRev}.tar.gz";
+ sha256 = "1pqdddp4aiz726c7qs1dwyfzixi14shp0mbzi1jhapl9hrajfsjg";
+ };
+ pkgs = import nixpkgs { config = { allowUnfree = true; }; };
+in
+pkgs.mkShell {
+ buildInputs = with pkgs; [
+ python36Packages.numpy
+ __THIS_IS_A_SYNTAX_ERROR_THAT_SHOULD_NOT_MATTER_AS_IT_ISNT_EXECUTED__
+ python36Packages.notebook
+ ];
+
+ shellHook = ''
+ export NIX_PATH="nixpkgs=${nixpkgs}:."
+ '';
+}

ADD
tests/nix/ignore-outside/start
+#!/bin/bash
+
+# this script should not be executed
+echo "The start script in the top level directory should not be executed"
+exit 1

ADD
tests/nix/ignore-outside/verify
+#!/bin/bash
+set -euo pipefail
+# check that numpy isn't installed
+test -z $(pip list | grep numpy | awk '{print $1}')

Add a test for nix using a binder subidrectory