From 56d4c7c5d69c9ee7b4e96c445ba4b78c4fc91407 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Sun, 3 Sep 2023 12:21:14 +0200 Subject: [PATCH] Add sagemath notebook flake --- sagemath-notebook/flake.nix | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 sagemath-notebook/flake.nix diff --git a/sagemath-notebook/flake.nix b/sagemath-notebook/flake.nix new file mode 100644 index 0000000..e7223bf --- /dev/null +++ b/sagemath-notebook/flake.nix @@ -0,0 +1,36 @@ +{ + description = "Sagemath flake"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils}: + flake-utils.lib.eachDefaultSystem + (system: + let + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + python-packages = ps: with ps; [ + jupyterlab + jupyterlab-git + jupyterlab-lsp + jupyterlab-widgets + ]; + in { + devShells.default = pkgs.mkShell { + buildInputs = with pkgs; [ + sage + (python311.withPackages python-packages) + ]; + + shellHook = '' + # sage --nodotsage -n --notebook-dir . + # TODO sage --nodotsage -n=jupyterlab --notebook-dir . + # exit + ''; + }; + } + ); +}