1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, jupyterhub
5, tornado
6, bash
7}:
8
9buildPythonPackage rec {
10 pname = "jupyterhub-systemdspawner";
11 version = "0.15";
12
13 src = fetchFromGitHub {
14 owner = "jupyterhub";
15 repo = "systemdspawner";
16 rev = "v${version}";
17 sha256 = "sha256-EUCA+CKCeYr+cLVrqTqe3Q32JkbqeALL6tfOnlVHk8Q=";
18 };
19
20 propagatedBuildInputs = [
21 jupyterhub
22 tornado
23 ];
24
25 buildInputs = [ bash ];
26
27 postPatch = ''
28 substituteInPlace systemdspawner/systemd.py \
29 --replace "/bin/bash" "${bash}/bin/bash"
30
31 substituteInPlace systemdspawner/systemdspawner.py \
32 --replace "/bin/bash" "${bash}/bin/bash"
33 '';
34
35 # no tests
36 doCheck = false;
37
38 postInstall = ''
39 mkdir -p $out/bin
40 cp check-kernel.bash $out/bin/
41 patchShebangs $out/bin
42 '';
43
44 meta = with lib; {
45 description = "JupyterHub Spawner using systemd for resource isolation";
46 homepage = "https://github.com/jupyterhub/systemdspawner";
47 license = licenses.bsd3;
48 maintainers = with maintainers; [ costrouc erictapen ];
49 };
50}