diff --git a/hosts/nixos/lapetus/secrets.example.yaml b/hosts/nixos/lapetus/secrets.example.yaml index 9f2aadb..0f6a0a7 100644 --- a/hosts/nixos/lapetus/secrets.example.yaml +++ b/hosts/nixos/lapetus/secrets.example.yaml @@ -12,3 +12,4 @@ microbin_env: | MICROBIN_ADMIN_PASSWORD=... MICROBIN_UPLOAD_PASSWORD=... forgejo_mail_password: ... +javi_password: ... diff --git a/hosts/nixos/lapetus/secrets.yaml b/hosts/nixos/lapetus/secrets.yaml index 3783cfd..22cc542 100644 --- a/hosts/nixos/lapetus/secrets.yaml +++ b/hosts/nixos/lapetus/secrets.yaml @@ -6,6 +6,7 @@ invidious_hmac_key: ENC[AES256_GCM,data:eN3NNPYUSfPNnVz3aZK7IrnzoBA=,iv:eHEiB/TK cloudflare_tunnel_credentials: ENC[AES256_GCM,data:XuXXzhGdxYsF1ik2g7yS2wbaI08/AF60P8CnIhjJlMd+jRk36QovuBRRjkfV8BjOg0K+2b4yNHT/nS/ZSV6eorj4sbczw6D+p7LxrQfeVqqhXWyCjbJwQTTDFU9XB2xUohmmC1PJ1/nwShfn1LocPxgwWQiNpqwhTJroojzqxTHUBzCuAMmcZ7jwvd0SlDpZIszhbTQoLRzedRZpCdoNnWTc,iv:2oBLU3SvNUwJ2OYfCmyKiocUw9zU+yixO+tY/AE9sxc=,tag:T3v+MII+kDzomiAQJ0zUdg==,type:str] microbin_env: ENC[AES256_GCM,data:nxiE9GIvEb0xgqomDdMyy2UtG25pt7h+6JUZkAgIejZbJfsKfpIJcG02WJoj07I2VeTtN10Wd8IbrW9QEt64mLzlG7hqJN0Uwq8bjL1j5IaK,iv:pCWmF52MhMfZtdtMsL7wwt+KB33E/UPNtXzkiJ7NOWE=,tag:79e0u2yyRYckivY85hLqpg==,type:str] forgejo_mail_password: ENC[AES256_GCM,data:linrpmA8b+8e1+tWNl0=,iv:Mk7suPq0Jt960Zl9s2jj3SSAKt4t8Lv4eKdIo0o8JbE=,tag:TZ0qGJIVSFSUt/0cqamvdw==,type:str] +javi_password: ENC[AES256_GCM,data:5Ifh/DclUz0/AL69Th/GckolrjerLOnDW77SOf+/L3v39T+EOYgK2GDNKtWGGWYX5sdxZ9JwLS3ZVsIOnN4zjFhgV+GChJWkkzjdpJEtpHlmmBKlyS31Fw7SixVkL3y3VJhw72aVv3bMKQ==,iv:FzAmvIlrhna5InsQCRrWVdrKZGmHMb0njWdvgBurdYs=,tag:/Iguu2FbdV/4RSGTnFdyYA==,type:str] sops: kms: [] gcp_kms: [] @@ -30,8 +31,8 @@ sops: RHZ6alYrUU5BZ2xlMkdGR1dWRG5aeGMKJdsdtVZ6Mk9Vo3a+tS+rzAgaF2wpH+8U lWhA+c0Kbe8EJT8hm7Vr8PqBmElz4V9AnXSCTp7D+Cu4pfWsHopLUQ== -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-05-10T22:27:23Z" - mac: ENC[AES256_GCM,data:pH8KM1JvO6OK1yGNT90kPfd7+zoUnyoTNfWhCXHBERzLmxHuI8VopCGfgxqYtjyBE4yYAIsRpzJBMPKSnazoL9EBWB+uoSE3UNXMgwTBK/Oq+aW1Bj7akOfCiR9U8yzgfqI7ReAtbioOVO3K/RlgCzpNFdfvToKwm7tUFrektB8=,iv:ltMnlbzIQumavl96q76sv9iYf4IgKrLS2yRZQ1xb83o=,tag:1PILpbzUR7LXaiuukrH3bw==,type:str] + lastmodified: "2024-05-21T00:38:43Z" + mac: ENC[AES256_GCM,data:/Aq7fQaIQmaG67xqW1P1GMgh8FYSoerR+eLZFRWTjcOaa71ZBt7+a4RAGDqQuoXUYoTxn4bBUKQBBbseMA2Wep9Z5JhGDNtzxVJbLHqVxC8NjLKQUV/M8ycBgTGvxFqHhcTeBbYfoNBgvMsOZpUCe8Utf+Z6BdEAzaDfKkRfT7M=,iv:ndCIVUOLoolhe77wxdUFMXBTKyf21i4dRrKoxtLf92k=,tag:GRXhswxIktIj35p7cJWjKA==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.8.1 diff --git a/hosts/nixos/lapetus/services/jupyter.nix b/hosts/nixos/lapetus/services/jupyter.nix index 650b652..be8bacc 100644 --- a/hosts/nixos/lapetus/services/jupyter.nix +++ b/hosts/nixos/lapetus/services/jupyter.nix @@ -1,16 +1,14 @@ { config, pkgs, ... }: +# {{{ Jupyterhub/lab env let appEnv = pkgs.python3.withPackages (p: with p; [ jupyterhub jupyterlab jupyterhub-systemdspawner jupyter-collaboration ]); + # }}} in { - services.nginx.virtualHosts."jupyter.moonythm.dev" = - config.satellite.proxy - config.services.jupyterhub.port - { proxyWebsockets = true; }; services.jupyterhub = { enable = true; @@ -20,25 +18,24 @@ in jupyterlabEnv = appEnv; extraConfig = '' - c.Authenticator.allowed_users = {'adrielus', 'prescientmoon'} - c.Authenticator.admin_users = {'adrielus', 'prescientmoon'} + c.Authenticator.allowed_users = {'adrielus', 'javi'} + c.Authenticator.admin_users = {'adrielus', 'javi'} c.Spawner.notebook_dir='${config.users.users.pilot.home}/projects/notebooks' - c.SystemdSpawner.mem_limit = '2G' c.SystemdSpawner.cpu_limit = 2.0 ''; # {{{ Python 3 kernel kernels.python3 = - let env = (pkgs.python3.withPackages (pythonPackages: with pythonPackages; [ + let env = (pkgs.python3.withPackages (p: with p; [ ipykernel - pandas - scikit-learn + numpy + scipy ])); in { - displayName = "Python 3 for machine learning"; + displayName = "Numerical mathematics setup"; argv = [ "${env.interpreter}" "-m" @@ -53,7 +50,23 @@ in # }}} }; + # {{{ Javi user + sops.secrets.javi_password = { + sopsFile = ../secrets.yaml; + neededForUsers = true; + }; + + users.users.javi.hashedPasswordFile = config.sops.secrets.javi_password.path; + # }}} + # {{{ Networking + services.nginx.virtualHosts."jupyter.moonythm.dev" = + config.satellite.proxy + config.services.jupyterhub.port + { proxyWebsockets = true; }; + # }}} + # {{{ Storage environment.persistence."/persist/state".directories = [ "/var/lib/${config.services.jupyterhub.stateDirectory}" ]; + # }}} }