Add Python Notebook flake

This commit is contained in:
Tibo De Peuter 2023-09-25 20:46:35 +02:00
parent 8343382cbc
commit 203f0ff268

31
notebook/python/flake.nix Normal file
View file

@ -0,0 +1,31 @@
{
description = "Jupyter notebook flake";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
python-packages = p: with p; [
imageio
jupyter
matplotlib
notebook
numpy
];
in {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
(python3.withPackages python-packages)
];
shellHook = ''
jupyter notebook ./CIEColorSpaces.ipynb && exit
'';
};
}
);
}