mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
fix(lint): nixfmt the whole tree
This commit is contained in:
parent
643b136863
commit
bf219a30c2
69 changed files with 2605 additions and 1726 deletions
|
|
@ -1,4 +1,9 @@
|
|||
{config, pkgs, lib, ...}:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.aviallon.services.jupyterhub;
|
||||
|
|
@ -7,12 +12,15 @@ in
|
|||
options.aviallon.services.jupyterhub = {
|
||||
enable = mkEnableOption "Jupyterhub server with Python 3 kernel";
|
||||
};
|
||||
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.jupyterhub = {
|
||||
enable = true;
|
||||
kernels.python3 = let
|
||||
env = (pkgs.python3.withPackages (pythonPackages: with pythonPackages; [
|
||||
kernels.python3 =
|
||||
let
|
||||
env = (
|
||||
pkgs.python3.withPackages (
|
||||
pythonPackages: with pythonPackages; [
|
||||
ipykernel
|
||||
pandas
|
||||
scikit-learn
|
||||
|
|
@ -20,20 +28,23 @@ in
|
|||
matplotlib
|
||||
numpy
|
||||
pip
|
||||
]));
|
||||
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";
|
||||
};
|
||||
]
|
||||
)
|
||||
);
|
||||
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";
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
|
|
@ -41,7 +52,12 @@ in
|
|||
};
|
||||
services.nginx.virtualHosts = {
|
||||
"jupyterhub.localhost" = {
|
||||
listen = [ { addr = "0.0.0.0"; port = 80; } ];
|
||||
listen = [
|
||||
{
|
||||
addr = "0.0.0.0";
|
||||
port = 80;
|
||||
}
|
||||
];
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString config.services.jupyterhub.port}";
|
||||
proxyWebsockets = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue