about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/jupyterhub-systemdspawner/default.nix
blob: 9907122b11357bfabcb84007385fd9bd25c333b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ lib
, buildPythonPackage
, fetchFromGitHub
, jupyterhub
, tornado
, bash
}:

buildPythonPackage rec {
  pname = "jupyterhub-systemdspawner";
  version = "0.15";

  src = fetchFromGitHub {
    owner = "jupyterhub";
    repo = "systemdspawner";
    rev = "v${version}";
    hash = "sha256-EUCA+CKCeYr+cLVrqTqe3Q32JkbqeALL6tfOnlVHk8Q=";
  };

  propagatedBuildInputs = [
    jupyterhub
    tornado
  ];

  buildInputs = [ bash ];

  postPatch = ''
    substituteInPlace systemdspawner/systemd.py \
      --replace "/bin/bash" "${bash}/bin/bash"

    substituteInPlace systemdspawner/systemdspawner.py \
      --replace "/bin/bash" "${bash}/bin/bash"
  '';

  # no tests
  doCheck = false;

  postInstall = ''
    mkdir -p $out/bin
    cp check-kernel.bash $out/bin/
    patchShebangs $out/bin
  '';

  meta = with lib; {
    description = "JupyterHub Spawner using systemd for resource isolation";
    homepage = "https://github.com/jupyterhub/systemdspawner";
    license = licenses.bsd3;
    maintainers = with maintainers; [ ];
  };
}