From 203f0ff2680d8c59ccb17c3b5e19b4fee91964c3 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Mon, 25 Sep 2023 20:46:35 +0200 Subject: [PATCH] Add Python Notebook flake --- notebook/python/flake.nix | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 notebook/python/flake.nix diff --git a/notebook/python/flake.nix b/notebook/python/flake.nix new file mode 100644 index 0000000..16b31b5 --- /dev/null +++ b/notebook/python/flake.nix @@ -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 + ''; + }; + } + ); +}