aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/python-modules/nix-kernel/default.nix
blob: 81057308e6b55a95ff6891de7d9942b3033f5d7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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 ];
  };
}