about summary refs log tree commit diff
path: root/pkgs/development/python-modules/nix-kernel
diff options
context:
space:
mode:
authorChris Ostrouchov <chris.ostrouchov@gmail.com>2020-08-08 12:56:46 -0400
committerJon <jonringer@users.noreply.github.com>2020-08-08 18:16:36 -0700
commit3f19239ee01f1baf7b1db09e9b397bbd796b32e7 (patch)
tree57d05330933c6487829e6465851863657fc6f946 /pkgs/development/python-modules/nix-kernel
parentbba261c785a0aa49dedf6143b4b2e43b5690103f (diff)
python3Packages.nix-kernel: init at 0.1
Diffstat (limited to 'pkgs/development/python-modules/nix-kernel')
-rw-r--r--pkgs/development/python-modules/nix-kernel/default.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/nix-kernel/default.nix b/pkgs/development/python-modules/nix-kernel/default.nix
new file mode 100644
index 0000000000000..81057308e6b55
--- /dev/null
+++ b/pkgs/development/python-modules/nix-kernel/default.nix
@@ -0,0 +1,45 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pexpect
+, notebook
+, nix
+}:
+
+buildPythonPackage rec {
+  pname = "nix-kernel";
+  version = "unstable-2020-04-26";
+
+  src = fetchFromGitHub {
+    owner = "GTrunSec";
+    repo = "nix-kernel";
+    rev = "dfa42d0812d508ded99f690ee1a83281d900a3ec";
+    sha256 = "1lf4rbbxjmq9h6g3wrdzx3v3dn1bndfmiybxiy0sjavgb6lzc8kq";
+  };
+
+  postPatch = ''
+    substituteInPlace nix-kernel/kernel.py \
+      --replace "'nix'" "'${nix}/bin/nix'" \
+      --replace "'nix repl'" "'${nix}/bin/nix repl'"
+
+    substituteInPlace setup.py \
+      --replace "cmdclass={'install': install_with_kernelspec}," ""
+  '';
+
+  propagatedBuildInputs = [
+    pexpect
+    notebook
+  ];
+
+  # no tests in repo
+  doCheck = false;
+
+  pythonImportsCheck = [ "nix-kernel" ];
+
+  meta = with lib; {
+    description = "Simple jupyter kernel for nix-repl";
+    homepage = "https://github.com/GTrunSec/nix-kernel";
+    license = licenses.mit;
+    maintainers = with maintainers; [ costrouc ];
+  };
+}