@@ -0,0 +1,45 @@
1+{ lib
2+, buildPythonPackage
3+, fetchFromGitHub
4+, pexpect
5+, notebook
6+, nix
7+}:
8+
9+buildPythonPackage rec {
10+ pname = "nix-kernel";
11+ version = "unstable-2020-04-26";
12+
13+ src = fetchFromGitHub {
14+ owner = "GTrunSec";
15+ repo = "nix-kernel";
16+ rev = "dfa42d0812d508ded99f690ee1a83281d900a3ec";
17+ sha256 = "1lf4rbbxjmq9h6g3wrdzx3v3dn1bndfmiybxiy0sjavgb6lzc8kq";
18+ };
19+
20+ postPatch = ''
21+ substituteInPlace nix-kernel/kernel.py \
22+ --replace "'nix'" "'${nix}/bin/nix'" \
23+ --replace "'nix repl'" "'${nix}/bin/nix repl'"
24+
25+ substituteInPlace setup.py \
26+ --replace "cmdclass={'install': install_with_kernelspec}," ""
27+ '';
28+
29+ propagatedBuildInputs = [
30+ pexpect
31+ notebook
32+ ];
33+
34+ # no tests in repo
35+ doCheck = false;
36+
37+ pythonImportsCheck = [ "nix-kernel" ];
38+
39+ meta = with lib; {
40+ description = "Simple jupyter kernel for nix-repl";
41+ homepage = "https://github.com/GTrunSec/nix-kernel";
42+ license = licenses.mit;
43+ maintainers = with maintainers; [ costrouc ];
44+ };
45+}