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";
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
command = "jupyter-lab --ServerApp.token='' --ServerApp.password=''";
password = "''";
ip = "*";
jupyterEnv = pkgs.python3.withPackages (p: with p; [
jupyterlab
jupyterlab-lsp
jupyterlab-pygments
user = "infinidoge";
group = "users";
notebookDir = "~/Notebooks";
# export
nbconvert
nbformat
kernels = {
python3 = mkPythonKernel "Python 3" (pkgs.python3.withPackages (p: with p; [
ipykernel
nbconvert
nbformat
# lsp
python-lsp-server
python-lsp-ruff
]);
matplotlib
numpy
pandas
scipy
]));
};
};
systemd.services.jupyter.path = with pkgs; [
jupyterPath = with pkgs; [
# export
pandoc
(texlive.combine {
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 // {
listenAddresses = [ "100.101.102.124" ];