Skip to content

Instantly share code, notes, and snippets.

@fusetim
Last active August 24, 2021 18:31
Show Gist options
  • Save fusetim/39073f5db3bd198f13ef60172fcf9b51 to your computer and use it in GitHub Desktop.
Save fusetim/39073f5db3bd198f13ef60172fcf9b51 to your computer and use it in GitHub Desktop.
Bash kernel for JupyterWith and Nix
{ name ? "nixpkgs", packages ? [] }:
let
pkgs = import <nixpkgs> {};
kernelSpecFile = pkgs.writeText "kernel.json" (builtins.toJSON {
displayName = "Bash";
argv = ["${pkgs.python3.interpreter}" "-m" "bash_kernel" "-f" "{connection_file}"];
language = "Bash";
});
BashKernel = pkgs.python3Packages.bash_kernel;
in
{
spec = BashKernel;
runtimePackages = packages pkgs ++ BashKernel.propagatedBuildInputs;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment