12 # nix run --impure --expr 'with import <nixpkgs> {}; jupyter-console.withSingleKernel coq-kernel.definition'
14 # Jupyter console with packages:
15 # nix run --impure --expr 'with import <nixpkgs> {}; jupyter-console.withSingleKernel (coq-kernel.definitionWithPackages [coqPackages.bignums])'
18 # nix run --impure --expr 'with import <nixpkgs> {}; jupyter.override { definitions.coq = coq-kernel.definition; }'
21 python = python3.withPackages (ps: [ ps.traitlets ps.jupyter-core ps.ipykernel (callPackage ./kernel.nix {}) ]);
23 logos = runCommand "coq-logos" { buildInputs = [ imagemagick ]; } ''
25 convert ${coq.src}/ide/coqide/coq.png -resize 32x32 $out/logo-32x32.png
26 convert ${coq.src}/ide/coqide/coq.png -resize 64x64 $out/logo-64x64.png
32 launcher = runCommand "coq-kernel-launcher" {
33 nativeBuildInputs = [ makeWrapper ];
37 makeWrapper ${python.interpreter} $out/bin/coq-kernel \
38 --add-flags "-m coq_jupyter" \
39 --suffix PATH : ${coq}/bin
42 definition = definitionWithPackages [];
44 definitionWithPackages = packages: {
45 displayName = "Coq " + coq.version;
47 "${launcher}/bin/coq-kernel"
52 logo32 = "${logos}/logo-32x32.png";
53 logo64 = "${logos}/logo-64x64.png";
55 COQPATH = lib.concatStringsSep ":" (map (x: "${x}/lib/coq/${coq.coq-version}/user-contrib/") packages);