templates/flakes/jupyter/flake.nix

35 lines
851 B
Nix

{
inputs = {
jupyterWith.url = "github:tweag/jupyterWith";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, jupyterWith, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
inherit (builtins) attrValues;
pkgs = import nixpkgs {
inherit system;
overlays = attrValues jupyterWith.overlays;
};
# Source https://github.com/tweag/jupyterWith
iPython = pkgs.kernels.iPythonWith {
name = "python";
packages = p: with p; [ numpy ];
};
jupyterLab = pkgs.jupyterlabWith {
kernels = [ iPython ];
};
in
{
apps.default = {
type = "app";
program = "${jupyterLab}/bin/jupyter-lab";
};
devShell = jupyterLab.env;
});
}