Skip to content

Commit b9280bc

Browse files
committed
python kernel libraries are accessible from interpreter
This lets the libraries that are accessible for the Python kernel be accessible from the terminal. In order to launch the Python interpreter, just run `python-$NAME`, where NAME is the name of the kernel given in the kernel configuration. The name given is different so that multiple Python kernels in the same environment do not clash due to having the same name.
1 parent 119c855 commit b9280bc

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

kernels/ipython/default.nix

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
, stdenv
33
, name ? "nixpkgs"
44
, packages ? (_:[])
5+
, writeScriptBin
56
}:
67

78
let
@@ -24,6 +25,10 @@ let
2425
logo64 = "logo-64x64.png";
2526
};
2627

28+
pythonBin = writeScriptBin "python-${name}" ''
29+
${kernelEnv.interpreter} "$@"
30+
'';
31+
2732
ipythonKernel = stdenv.mkDerivation {
2833
name = "ipython-${name}";
2934
src = ./python.png;
@@ -37,5 +42,8 @@ let
3742
in
3843
{
3944
spec = ipythonKernel;
40-
runtimePackages = [];
45+
runtimePackages = [
46+
# Lets the user to use libraries from the Python command.
47+
pythonBin
48+
];
4149
}

0 commit comments

Comments
 (0)