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