Files
nix-dotfiles-v2/modules/jupyterhub.nix
T
adriangl 8173b617e7 refactor: unify python packages across jupyter, devel and home configs
- Create modules/python-packages.nix as single source of truth for 51 packages
- Update develPackages.nix to use shared package list with jupyter included
- Update jupyterhub.nix kernel to use shared package list
- Update home/python.nix to use shared package list
- Disable kicad/easyeda2kicad (transient GitLab download corruption)
2026-03-23 14:41:09 +01:00

74 lines
1.5 KiB
Nix

{
config,
pkgs,
lib,
...
}:
let
myPythonPackages = import ./python-packages.nix;
myPython = pkgs.python3;
myJupyterHubEnv = myPython.withPackages (
ps:
with ps;
[
jupyterhub
jupyterhub-systemdspawner
]
++ myPythonPackages ps
);
myJupyterLabEnv = myPython.withPackages (
ps:
with ps;
[
jupyterhub
]
++ myPythonPackages ps
);
in
{
users.users.tdt4117 = {
isNormalUser = true;
home = "/home/tdt4117";
description = "tdt4117 - delete after h25";
extraGroups = [ ];
# openssh.authorizedKeys.keys = [ "ssh-dss AAAAB3Nza... " ];
};
services.jupyterhub = {
jupyterhubEnv = myJupyterHubEnv;
jupyterlabEnv = myJupyterLabEnv;
enable = true;
port = 8770;
host = "0.0.0.0";
extraConfig = ''
c.Authenticator.allow_all = True
c.ConfigurableHTTPProxy.api_url = 'http://0.0.0.0:8770'
c.JupyterHub.bind_url = 'http://0.0.0.0:8771'
'';
kernels = {
python3 =
let
env = pkgs.python3.withPackages myPythonPackages;
in
{
displayName = "Python 3 for machine learning";
argv = [
"${env.interpreter}"
"-m"
"ipykernel_launcher"
"-f"
"{connection_file}"
];
language = "python";
logo32 = "${env}/${env.sitePackages}/ipykernel/resources/logo-32x32.png";
logo64 = "${env}/${env.sitePackages}/ipykernel/resources/logo-64x64.png";
};
};
};
}