From cb20d078360ec9235b9b3a78d7950ded1f601267 Mon Sep 17 00:00:00 2001 From: Emile Date: Tue, 26 Mar 2024 10:30:12 +0100 Subject: ports.nix file containing the used ports in a central location Done and deployed in the 15min train ride to the office, quick and easy! --- nix/hosts/corrino/www/jupyter.emile.space.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'nix/hosts/corrino/www/jupyter.emile.space.nix') diff --git a/nix/hosts/corrino/www/jupyter.emile.space.nix b/nix/hosts/corrino/www/jupyter.emile.space.nix index d1d951c..18e56a0 100644 --- a/nix/hosts/corrino/www/jupyter.emile.space.nix +++ b/nix/hosts/corrino/www/jupyter.emile.space.nix @@ -1,22 +1,24 @@ -{ pkgs, lib, config, ... }: +{ pkgs, config, ... }: -{ +let + ports = import ../ports.nix; +in { services.nginx.virtualHosts."jupyter.emile.space" = { forceSSL = true; enableACME = true; locations = { "/" = { - proxyPass = "http://127.0.0.1:8004"; + proxyPass = "http://127.0.0.1:${toString config.services.jupyter.port}"; }; }; }; - services.jupyter = rec { + services.jupyter = { enable = true; ip = "127.0.0.1"; - port = 8004; + port = ports.jupyter; # ; python3 # >>> from notebook.auth import passwd @@ -57,4 +59,4 @@ users.users.jupyter.group = "jupyter"; users.groups.jupyter = {}; -} \ No newline at end of file +} -- cgit 1.4.1