From 0f221053a10ac016d6f0d7f466f01aebf298d1dd Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Thu, 18 Jan 2024 14:35:59 +0100 Subject: [PATCH] Add jupyter template --- jupyter/.envrc | 1 + jupyter/flake.nix | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 jupyter/.envrc create mode 100644 jupyter/flake.nix diff --git a/jupyter/.envrc b/jupyter/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/jupyter/.envrc @@ -0,0 +1 @@ +use flake diff --git a/jupyter/flake.nix b/jupyter/flake.nix new file mode 100644 index 0000000..06c7fdd --- /dev/null +++ b/jupyter/flake.nix @@ -0,0 +1,25 @@ +{ + description = "A Nix-flake-based Python development environment"; + + inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; + + outputs = { + self, + nixpkgs, + }: let + supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; + forEachSupportedSystem = f: + nixpkgs.lib.genAttrs supportedSystems (system: + f { + pkgs = import nixpkgs {inherit system;}; + }); + in { + devShells = forEachSupportedSystem ({pkgs}: { + default = pkgs.mkShell { + packages = with pkgs; + [python311 virtualenv] + ++ (with pkgs.python311Packages; [pip jupyter pandas numpy matplotlib]); + }; + }); + }; +}