{ nextcloudPackage, nextcloudHost, nextcloudHostname, ... }: { config, lib, pkgs, ... }: with lib; let hostname = config.instance.hostname; host = config.fudo.hosts."${hostname}"; isNextcloud = hostname == nextcloudHost; port = config.services.nextcloudContainer.port; in { config = mkIf isNextcloud { services = { nextcloudContainer = { enable = true; hostname = nextcloudHostname; package = nextcloudPackage; extra-apps = with config.services.nextcloudContainer.package.packages.apps; { inherit contacts calendar tasks maps mail bookmarks notes user_saml; # files_markdown memories news unsplash }; timezone = "America/Winnipeg"; }; nginx = { enable = true; recommendedOptimisation = true; recommendedGzipSettings = true; recommendedProxySettings = true; virtualHosts."${nextcloudHostname}" = { enableACME = true; forceSSL = true; locations."/" = { proxyPass = "http://localhost:${toString port}"; proxyWebsockets = true; }; extraConfig = '' client_body_buffer_size 1024m; client_max_body_size 4096m; fastcgi_read_timeout 120s; proxy_max_temp_file_size 4096m; proxy_buffering off; ''; }; }; }; }; }