From 3ef375132b8e13fa7ec5a566f0ccfa27d8cda257 Mon Sep 17 00:00:00 2001 From: Valentin Date: Thu, 6 Nov 2025 15:41:26 +0100 Subject: Vereinfachte Handhabung von Ports in der virtuellen Maschine --- www/caddy.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'www') diff --git a/www/caddy.nix b/www/caddy.nix index 2281464..8797204 100644 --- a/www/caddy.nix +++ b/www/caddy.nix @@ -44,25 +44,21 @@ in lib, ... }: - let - httpPort = 800; - in { services.caddy.globalConfig = '' local_certs ''; services.caddy.virtualHosts = { - "http://localhost:${toString httpPort}".extraConfig = + "http://www.localhost:${toString config.virtualisation.exposedPorts.http.port}".extraConfig = config.services.caddy.virtualHosts.${self.domain}.extraConfig; }; - networking.firewall.allowedTCPPorts = [ - httpPort - ]; systemd.services.caddy.path = [ pkgs.nssTools ]; # Irrelevante Warnung unterdrücken services.getty.helpLine = lib.mkBefore '' - ${self.domain}: http://localhost:${toString (config.virtualisation.portOffset + httpPort)} + ${self.domain}: http://www.localhost:${ + with config.virtualisation; toString (portOffset + exposedPorts.http.port) + } ''; }; }; -- cgit v1.2.3