2025-04-01 00:39:43 +03:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2024-05-23 13:39:48 +03:00
|
|
|
{
|
2025-01-20 22:30:30 +02:00
|
|
|
imports = [ ./cert-store-client.nix ];
|
2025-01-08 13:10:43 +02:00
|
|
|
|
2025-04-01 00:39:43 +03:00
|
|
|
options.custom.nextcloud_domain = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "Domain used by Nextcloud";
|
|
|
|
};
|
2024-05-23 13:39:48 +03:00
|
|
|
|
2025-04-01 00:39:43 +03:00
|
|
|
config = {
|
|
|
|
networking.firewall.allowedTCPPorts = [ 443 ];
|
|
|
|
|
|
|
|
services = {
|
|
|
|
nextcloud = {
|
|
|
|
package = pkgs.nextcloud31;
|
|
|
|
enable = true;
|
|
|
|
hostName = config.custom.nextcloud_domain;
|
|
|
|
autoUpdateApps.enable = true;
|
|
|
|
https = true;
|
|
|
|
maxUploadSize = "512M"; # Default
|
|
|
|
config = {
|
|
|
|
adminpassFile = "/var/lib/nextcloud/adminpass";
|
|
|
|
};
|
|
|
|
settings = {
|
|
|
|
overwriteprotocol = "https";
|
|
|
|
default_phone_region = "FI";
|
|
|
|
maintenance_window_start = 1;
|
|
|
|
};
|
|
|
|
phpOptions = {
|
|
|
|
"opcache.interned_strings_buffer" = 32;
|
|
|
|
};
|
2024-12-03 23:46:24 +02:00
|
|
|
};
|
2024-05-23 13:39:48 +03:00
|
|
|
|
2025-04-01 00:39:43 +03:00
|
|
|
nginx = {
|
|
|
|
recommendedGzipSettings = true;
|
|
|
|
recommendedOptimisation = true;
|
|
|
|
recommendedTlsSettings = true;
|
|
|
|
recommendedProxySettings = true;
|
2024-12-03 23:46:24 +02:00
|
|
|
|
2025-04-01 00:39:43 +03:00
|
|
|
virtualHosts.${config.services.nextcloud.hostName} = {
|
|
|
|
forceSSL = true;
|
|
|
|
kTLS = true;
|
|
|
|
sslCertificate = "/mnt/acme/fullchain.pem";
|
|
|
|
sslCertificateKey = "/mnt/acme/key.pem";
|
|
|
|
};
|
2024-06-02 05:53:39 +03:00
|
|
|
};
|
|
|
|
};
|
2024-06-02 16:18:19 +03:00
|
|
|
};
|
|
|
|
}
|