kopia lustrzana https://github.com/jupyterhub/repo2docker
Add a test for nix using a binder subidrectory
rodzic
c924f5fa48
commit
fcab15b092
|
@ -0,0 +1,5 @@
|
|||
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.
|
|
@ -0,0 +1,19 @@
|
|||
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}:."
|
||||
'';
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
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}:."
|
||||
'';
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
# this script should not be executed
|
||||
echo "The start script in the top level directory should not be executed"
|
||||
exit 1
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
# check that numpy isn't installed
|
||||
test -z $(pip list | grep numpy | awk '{print $1}')
|
Ładowanie…
Reference in New Issue