templates/flakes/jupyter/flake.nix

35 lines
851 B
Nix
Raw Normal View History

2022-09-08 17:53:22 +03:00
{
inputs = {
jupyterWith.url = "github:tweag/jupyterWith";
2022-10-21 03:41:22 +03:00
flake-utils.url = "github:numtide/flake-utils";
2022-09-08 17:53:22 +03:00
};
2022-10-21 03:41:22 +03:00
outputs = { self, nixpkgs, jupyterWith, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
2022-09-08 17:53:22 +03:00
let
2022-10-21 03:41:22 +03:00
inherit (builtins) attrValues;
2022-09-08 17:53:22 +03:00
pkgs = import nixpkgs {
inherit system;
2022-10-21 03:41:22 +03:00
overlays = attrValues jupyterWith.overlays;
2022-09-08 17:53:22 +03:00
};
# 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;
});
}