Clean up Nextcloud config

This commit is contained in:
Vili Sinervä 2025-04-01 00:39:43 +03:00
parent c544ae4771
commit 8bde1eb549
No known key found for this signature in database
GPG key ID: DF8FEAF54EFAC996
2 changed files with 44 additions and 29 deletions

View file

@ -1,6 +1,7 @@
{ ... }: { ... }:
{ {
networking.hostName = "nextcloud"; networking.hostName = "nextcloud";
custom.nextcloud_domain = "nextcloud.vsinerva.fi";
imports = [ imports = [
../base.nix ../base.nix

View file

@ -1,39 +1,53 @@
{ config, pkgs, ... }: {
config,
pkgs,
lib,
...
}:
{ {
imports = [ ./cert-store-client.nix ]; imports = [ ./cert-store-client.nix ];
networking.firewall.allowedTCPPorts = [ 443 ]; options.custom.nextcloud_domain = lib.mkOption {
networking.firewall.allowedUDPPorts = [ 443 ]; type = lib.types.str;
description = "Domain used by Nextcloud";
};
services = { config = {
nextcloud = { networking.firewall.allowedTCPPorts = [ 443 ];
package = pkgs.nextcloud31;
enable = true; services = {
hostName = "nextcloud.vsinerva.fi"; nextcloud = {
autoUpdateApps.enable = true; package = pkgs.nextcloud31;
https = true; enable = true;
maxUploadSize = "10G"; hostName = config.custom.nextcloud_domain;
config = { autoUpdateApps.enable = true;
adminpassFile = "/var/lib/nextcloud/adminpass"; 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;
};
}; };
settings = {
overwriteprotocol = "https";
maintenancce_window_start = 1;
opcache.interned_strings_buffer = 32;
};
};
nginx = { nginx = {
recommendedGzipSettings = true; recommendedGzipSettings = true;
recommendedOptimisation = true; recommendedOptimisation = true;
recommendedTlsSettings = true; recommendedTlsSettings = true;
recommendedProxySettings = true; recommendedProxySettings = true;
virtualHosts.${config.services.nextcloud.hostName} = { virtualHosts.${config.services.nextcloud.hostName} = {
forceSSL = true; forceSSL = true;
kTLS = true; kTLS = true;
sslCertificate = "/mnt/acme/fullchain.pem"; sslCertificate = "/mnt/acme/fullchain.pem";
sslCertificateKey = "/mnt/acme/key.pem"; sslCertificateKey = "/mnt/acme/key.pem";
};
}; };
}; };
}; };