about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/nix-kernel/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/nix-kernel/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/nix-kernel/default.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/nix-kernel/default.nix b/nixpkgs/pkgs/development/python-modules/nix-kernel/default.nix
new file mode 100644
index 000000000000..81057308e6b5
--- /dev/null
+++ b/nixpkgs/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 ];
+  };
+}