25 lines
499 B
Nix
25 lines
499 B
Nix
|
{
|
||
|
pkgs,
|
||
|
name,
|
||
|
pyenv,
|
||
|
...
|
||
|
}: let
|
||
|
interpreter = pyenv.interpreter; # TODO ensure ipykernel package installed somehow...
|
||
|
in
|
||
|
pkgs.writeTextFile {
|
||
|
name = "${name}-ipykernel";
|
||
|
destination = "/kernels/${name}/kernel.json";
|
||
|
text = builtins.toJSON {
|
||
|
display_name = name;
|
||
|
argv = [
|
||
|
"${interpreter}"
|
||
|
"-m"
|
||
|
"ipykernel_launcher"
|
||
|
"-f"
|
||
|
"{connection_file}"
|
||
|
];
|
||
|
language = "python";
|
||
|
metadata = {debugger = true;};
|
||
|
};
|
||
|
}
|