1{
2 lib,
3 bash,
4 buildPythonPackage,
5 fetchFromGitHub,
6 jupyterhub,
7 pythonOlder,
8 setuptools,
9 tornado,
10}:
11
12buildPythonPackage rec {
13 pname = "jupyterhub-systemdspawner";
14 version = "1.0.2";
15 pyproject = true;
16
17 disabled = pythonOlder "3.8";
18
19 src = fetchFromGitHub {
20 owner = "jupyterhub";
21 repo = "systemdspawner";
22 tag = "v${version}";
23 hash = "sha256-obM8HGCHsisRV1+kHMWdA7d6eb6awwPMBuDUAf3k0uI=";
24 };
25
26 postPatch = ''
27 substituteInPlace systemdspawner/systemdspawner.py \
28 --replace-fail "/bin/bash" "${bash}/bin/bash"
29 '';
30
31 build-system = [ setuptools ];
32
33 dependencies = [
34 jupyterhub
35 tornado
36 ];
37
38 # Module has no tests
39 doCheck = false;
40
41 postInstall = ''
42 mkdir -p $out/bin
43 cp check-kernel.bash $out/bin/
44 patchShebangs $out/bin
45 '';
46
47 pythonImportsCheck = [ "systemdspawner" ];
48
49 meta = with lib; {
50 description = "JupyterHub Spawner using systemd for resource isolation";
51 mainProgram = "check-kernel.bash";
52 homepage = "https://github.com/jupyterhub/systemdspawner";
53 changelog = "https://github.com/jupyterhub/systemdspawner/blob/v${version}/CHANGELOG.md";
54 license = licenses.bsd3;
55 maintainers = [ ];
56 };
57}