2023-10-02 22:48:18 +02:00
|
|
|
{ config, pkgs, ... }:
|
2023-09-11 11:17:30 +02:00
|
|
|
|
2023-10-02 22:48:18 +02:00
|
|
|
let host = "cloud.dgnum.eu";
|
2023-09-11 11:17:30 +02:00
|
|
|
in {
|
|
|
|
services.nextcloud = {
|
|
|
|
enable = true;
|
|
|
|
hostName = host;
|
|
|
|
|
|
|
|
package = pkgs.nextcloud27;
|
|
|
|
|
|
|
|
https = true;
|
|
|
|
|
|
|
|
config = {
|
|
|
|
overwriteProtocol = "https";
|
|
|
|
|
|
|
|
dbtype = "pgsql";
|
|
|
|
|
|
|
|
adminpassFile = config.age.secrets."nextcloud-adminpass_file".path;
|
|
|
|
adminuser = "thubrecht";
|
|
|
|
|
|
|
|
defaultPhoneRegion = "FR";
|
|
|
|
|
|
|
|
trustedProxies = [ "::1" ];
|
2023-09-11 18:56:07 +02:00
|
|
|
|
|
|
|
objectstore.s3 = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
hostname = "s3.dgnum.eu";
|
|
|
|
region = "garage";
|
|
|
|
usePathStyle = true;
|
|
|
|
port = 443;
|
|
|
|
|
|
|
|
bucket = "nextcloud-dgnum";
|
|
|
|
key = "GKda5367c73ca607c349d83c35";
|
|
|
|
autocreate = false;
|
|
|
|
secretFile = config.age.secrets."nextcloud-s3_secret_file".path;
|
|
|
|
};
|
2023-09-11 11:17:30 +02:00
|
|
|
};
|
|
|
|
|
2023-11-22 09:37:58 +01:00
|
|
|
poolSettings = {
|
|
|
|
pm = "dynamic";
|
|
|
|
"pm.max_children" = 64;
|
|
|
|
"pm.max_requests" = "500";
|
|
|
|
"pm.max_spare_servers" = "8";
|
|
|
|
"pm.min_spare_servers" = "4";
|
|
|
|
"pm.start_servers" = "6";
|
|
|
|
};
|
|
|
|
|
2023-11-22 16:01:49 +01:00
|
|
|
phpOptions = {
|
|
|
|
short_open_tag = "Off";
|
|
|
|
expose_php = "Off";
|
|
|
|
error_reporting = "E_ALL & ~E_DEPRECATED & ~E_STRICT";
|
|
|
|
display_errors = "stderr";
|
|
|
|
"opcache.enable_cli" = "1";
|
|
|
|
"opcache.interned_strings_buffer" = "32";
|
|
|
|
"opcache.max_accelerated_files" = "10000";
|
|
|
|
"opcache.memory_consumption" = "128";
|
|
|
|
"opcache.revalidate_freq" = "1";
|
|
|
|
"opcache.fast_shutdown" = "1";
|
|
|
|
"openssl.cafile" = "/etc/ssl/certs/ca-certificates.crt";
|
|
|
|
catch_workers_output = "yes";
|
|
|
|
};
|
|
|
|
|
2023-09-11 11:17:30 +02:00
|
|
|
notify_push = { enable = true; };
|
|
|
|
|
|
|
|
database.createLocally = true;
|
|
|
|
configureRedis = true;
|
|
|
|
|
|
|
|
autoUpdateApps.enable = true;
|
|
|
|
|
|
|
|
enableBrokenCiphersForSSE = false;
|
|
|
|
|
|
|
|
extraOptions = {
|
|
|
|
overwritehost = host;
|
|
|
|
"overwrite.cli.url" = "https://${host}";
|
|
|
|
updatechecker = false;
|
|
|
|
|
|
|
|
allow_local_remote_servers = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-11-22 16:07:05 +01:00
|
|
|
systemd.services.nextcloud-preview = {
|
|
|
|
script = "nextcloud-occ preview:pre-generate -vvv";
|
|
|
|
startAt = "*-*-* 01:00:00 UTC";
|
|
|
|
};
|
|
|
|
|
2023-09-11 11:17:30 +02:00
|
|
|
services.nginx.virtualHosts.${host} = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
};
|
|
|
|
|
2023-09-24 13:16:57 +02:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
ffmpeg_6-headless
|
|
|
|
jpegoptim
|
|
|
|
exif
|
2023-11-14 15:41:24 +01:00
|
|
|
perl
|
2023-11-20 17:24:37 +01:00
|
|
|
perlPackages.ImageExifTool
|
2023-09-24 13:16:57 +02:00
|
|
|
];
|
2023-09-15 18:19:11 +02:00
|
|
|
|
2023-10-02 22:48:18 +02:00
|
|
|
dgn-secrets.matches."^nextcloud-.*$" = { owner = "nextcloud"; };
|
2023-09-11 11:17:30 +02:00
|
|
|
}
|