2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
bash,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
jupyterhub,
|
|
|
|
pythonOlder,
|
|
|
|
tornado,
|
2020-08-20 17:08:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "jupyterhub-systemdspawner";
|
2023-08-22 20:05:09 +00:00
|
|
|
version = "1.0.1";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jupyterhub";
|
|
|
|
repo = "systemdspawner";
|
2023-08-22 20:05:09 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-2Pxswa472umovHBUVTIX1l+Glj6bzzgBLsu+p4IA6jA=";
|
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"
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = [ bash ];
|
2023-08-22 20:05:09 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
jupyterhub
|
|
|
|
tornado
|
|
|
|
];
|
|
|
|
|
|
|
|
# Module has no tests
|
2021-02-13 14:23:35 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp check-kernel.bash $out/bin/
|
|
|
|
patchShebangs $out/bin
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "systemdspawner" ];
|
2023-08-22 20:05:09 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "JupyterHub Spawner using systemd for resource isolation";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "check-kernel.bash";
|
2020-08-20 17:08:02 +00:00
|
|
|
homepage = "https://github.com/jupyterhub/systemdspawner";
|
2023-08-22 20:05:09 +00:00
|
|
|
changelog = "https://github.com/jupyterhub/systemdspawner/blob/v${version}/CHANGELOG.md";
|
2020-08-20 17:08:02 +00:00
|
|
|
license = licenses.bsd3;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
}
|