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 --- nextcloud.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'nextcloud.nix') diff --git a/nextcloud.nix b/nextcloud.nix index df89990..eedb507 100644 --- a/nextcloud.nix +++ b/nextcloud.nix @@ -79,13 +79,12 @@ { config, lib, ... }: let - httpPort = 900; nextcloud = config.services.nextcloud.hostName; in { services.nextcloud = { https = lib.mkForce false; - hostName = lib.mkForce "localhost"; + hostName = lib.mkForce "nextcloud.localhost"; }; systemd.tmpfiles.rules = [ @@ -94,14 +93,13 @@ ]; services.caddy.virtualHosts = { - "http://localhost:${toString httpPort}".extraConfig = + "http://${nextcloud}:${toString config.virtualisation.exposedPorts.http.port}".extraConfig = config.services.caddy.virtualHosts.${nextcloud}.extraConfig; }; - networking.firewall.allowedTCPPorts = [ - httpPort - ]; services.getty.helpLine = lib.mkBefore '' - Nextcloud: http://localhost:${toString (config.virtualisation.portOffset + httpPort)} + Nextcloud: http://${nextcloud}:${ + with config.virtualisation; toString (portOffset + exposedPorts.http.port) + } ''; }; }; -- cgit v1.2.3