Infini-DL360/jupyter: refactor to install lab extensions

This commit is contained in:
Infinidoge 2024-10-23 01:33:27 -04:00
parent 8ab44e466d
commit 3bdc48c7d6
Signed by: Infinidoge
SSH key fingerprint: SHA256:EMoPe5e2dO0gEvtBb2xkZTz5dkyL0rBmuiGTKG5s96E

View file

@ -9,36 +9,23 @@ let
logo32 = "${env}/${env.sitePackages}/ipykernel/resources/logo-32x32.png"; logo32 = "${env}/${env.sitePackages}/ipykernel/resources/logo-32x32.png";
logo64 = "${env}/${env.sitePackages}/ipykernel/resources/logo-64x64.png"; logo64 = "${env}/${env.sitePackages}/ipykernel/resources/logo-64x64.png";
}; };
in
{
services.jupyter = {
enable = true;
package = pkgs.python3Packages.jupyterlab;
# Hosted behind Tailscale, so security doesn't matter jupyterEnv = pkgs.python3.withPackages (p: with p; [
command = "jupyter-lab --ServerApp.token='' --ServerApp.password=''"; jupyterlab
password = "''"; jupyterlab-lsp
ip = "*"; jupyterlab-pygments
user = "infinidoge"; # export
group = "users";
notebookDir = "~/Notebooks";
kernels = {
python3 = mkPythonKernel "Python 3" (pkgs.python3.withPackages (p: with p; [
ipykernel
nbconvert nbconvert
nbformat nbformat
matplotlib # lsp
numpy python-lsp-server
pandas python-lsp-ruff
scipy ]);
]));
};
};
systemd.services.jupyter.path = with pkgs; [ jupyterPath = with pkgs; [
# export
pandoc pandoc
(texlive.combine { (texlive.combine {
inherit (texlive) inherit (texlive)
@ -54,6 +41,34 @@ in
; ;
}) })
]; ];
in
{
services.jupyter = {
enable = true;
package = jupyterEnv;
# Hosted behind Tailscale, so security doesn't matter
command = "jupyter-lab --ServerApp.token='' --ServerApp.password=''";
password = "''";
ip = "*";
user = "infinidoge";
group = "users";
notebookDir = "~/Notebooks";
kernels = {
python3 = mkPythonKernel "Python 3" (pkgs.python3.withPackages (p: with p; [
ipykernel
matplotlib
numpy
pandas
scipy
]));
};
};
systemd.services.jupyter.path = jupyterPath;
services.nginx.virtualHosts."jupyter.internal.inx.moe" = common.nginx.ssl // { services.nginx.virtualHosts."jupyter.internal.inx.moe" = common.nginx.ssl // {
listenAddresses = [ "100.101.102.124" ]; listenAddresses = [ "100.101.102.124" ];