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/netbox.emile.space.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'nix/hosts/corrino/www/netbox.emile.space.nix') diff --git a/nix/hosts/corrino/www/netbox.emile.space.nix b/nix/hosts/corrino/www/netbox.emile.space.nix index a86209c..3f07bf5 100644 --- a/nix/hosts/corrino/www/netbox.emile.space.nix +++ b/nix/hosts/corrino/www/netbox.emile.space.nix @@ -1,13 +1,15 @@ { config, pkgs, ... }: -{ +let + ports = import ../ports.nix; +in { services.nginx.virtualHosts."netbox.emile.space" = { forceSSL = true; enableACME = true; kTLS = true; locations."/" = { - proxyPass = "http://[::1]:8001"; + proxyPass = "http://[::1]:${toString config.services.netbox.port}"; proxyWebsockets = true; }; locations."/static/".root = "${config.services.netbox.dataDir}"; @@ -25,7 +27,7 @@ enableLdap = false; settings = {}; secretKeyFile = config.age.secrets.netbox_secret.path; - port = 8001; + port = ports.netbox; listenAddress = "[::1]"; }; -- cgit 1.4.1