2020-08-20 17:08:02 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2021-12-06 16:07:01 +00:00
|
|
|
, fetchFromGitHub
|
2020-08-20 17:08:02 +00:00
|
|
|
, jupyterhub
|
|
|
|
, tornado
|
|
|
|
, bash
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "jupyterhub-systemdspawner";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.15";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jupyterhub";
|
|
|
|
repo = "systemdspawner";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-EUCA+CKCeYr+cLVrqTqe3Q32JkbqeALL6tfOnlVHk8Q=";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
jupyterhub
|
|
|
|
tornado
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
buildInputs = [ bash ];
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace systemdspawner/systemd.py \
|
|
|
|
--replace "/bin/bash" "${bash}/bin/bash"
|
|
|
|
|
|
|
|
substituteInPlace systemdspawner/systemdspawner.py \
|
|
|
|
--replace "/bin/bash" "${bash}/bin/bash"
|
|
|
|
'';
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
# no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp check-kernel.bash $out/bin/
|
|
|
|
patchShebangs $out/bin
|
|
|
|
'';
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "JupyterHub Spawner using systemd for resource isolation";
|
|
|
|
homepage = "https://github.com/jupyterhub/systemdspawner";
|
|
|
|
license = licenses.bsd3;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ costrouc erictapen ];
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
}
|