From 4a48b34ead2b9ecde64fb3d3421cc78f4a601793 Mon Sep 17 00:00:00 2001 From: Kerstin Humm Date: Sun, 28 Nov 2021 00:50:19 +0100 Subject: [PATCH] python3Packages.jupyterhub-systemdspawner: install check-kernel.bash This file allows for easy checking wether the kernel is configured correctly for running the spawner. For that I had to use the sources from GitHub. Also added myself as maintainer. --- .../jupyterhub-systemdspawner/default.nix | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/jupyterhub-systemdspawner/default.nix b/pkgs/development/python-modules/jupyterhub-systemdspawner/default.nix index bd3e073a7724..1d0c7f1e7c16 100644 --- a/pkgs/development/python-modules/jupyterhub-systemdspawner/default.nix +++ b/pkgs/development/python-modules/jupyterhub-systemdspawner/default.nix @@ -1,6 +1,6 @@ { lib , buildPythonPackage -, fetchPypi +, fetchFromGitHub , jupyterhub , tornado , bash @@ -10,9 +10,14 @@ buildPythonPackage rec { pname = "jupyterhub-systemdspawner"; version = "0.15.0"; - src = fetchPypi { - inherit pname version; - sha256 = "b6e2d981657aa5d3794abb89b1650d056524158a3d0f0f706007cae9b6dbeb2b"; + src = fetchFromGitHub { + owner = "jupyterhub"; + repo = "systemdspawner"; + # Corresponds to 0.15.0 + # Upstream didn't tag the latest release: + # https://github.com/jupyterhub/systemdspawner/issues/89 + rev = "7d7cf42db76d9cfa5a4bc42fff14943877ac570b"; + sha256 = "sha256-EUCA+CKCeYr+cLVrqTqe3Q32JkbqeALL6tfOnlVHk8Q="; }; propagatedBuildInputs = [ @@ -20,6 +25,8 @@ buildPythonPackage rec { tornado ]; + buildInputs = [ bash ]; + postPatch = '' substituteInPlace systemdspawner/systemd.py \ --replace "/bin/bash" "${bash}/bin/bash" @@ -31,10 +38,16 @@ buildPythonPackage rec { # 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 = [ maintainers.costrouc ]; + maintainers = with maintainers; [ costrouc erictapen ]; }; }