From 33532253e6ecac60666617dbbe64cb98c7ae31ed Mon Sep 17 00:00:00 2001 From: MoritzBoehme Date: Mon, 22 Nov 2021 11:09:21 +0100 Subject: [PATCH] adds jupyter notebook service --- modules/services/default.nix | 9 ++++++++- modules/services/jupyter.nix | 38 ++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 modules/services/jupyter.nix diff --git a/modules/services/default.nix b/modules/services/default.nix index 26cf3a4..254e93c 100644 --- a/modules/services/default.nix +++ b/modules/services/default.nix @@ -1,7 +1,14 @@ { config, lib, pkgs, ... }: { - imports = [ ./dunst ./agenix.nix ./diskstation ./picom.nix ./kdeconnect.nix ]; + imports = [ + ./agenix.nix + ./diskstation + ./dunst + ./jupyter.nix + ./kdeconnect.nix + ./picom.nix + ]; services = { printing.enable = true; diff --git a/modules/services/jupyter.nix b/modules/services/jupyter.nix new file mode 100644 index 0000000..0c70dd9 --- /dev/null +++ b/modules/services/jupyter.nix @@ -0,0 +1,38 @@ +{ config, lib, pkgs, ... }: + +{ + # Create jupyter user + users.users.jupyter.group = "jupyter"; + users.users.jupyter.isSystemUser = true; + users.groups.jupyter = { }; + + services.jupyter = { + enable = true; + password = + "'argon2:$argon2id$v=19$m=10240,t=10,p=8$rILNOtQ9WhacuEhV5zW2CQ$Gvbql8TEqBxPhKeMVwKZPQ'"; + kernels = { + python3 = + let + env = pkgs.python3.withPackages (pythonPackages: + with pythonPackages; [ + ipykernel + pandas + scikit-learn + ]); + in + { + displayName = "Python 3 for machine learning"; + argv = [ + "${env.interpreter}" + "-m" + "ipykernel_launcher" + "-f" + "{connection_file}" + ]; + language = "python"; + logo32 = null; + logo64 = null; + }; + }; + }; +}