nixos/modules/server/services/local/nextcloud/default.nix

94 lines
2.7 KiB
Nix
Raw Normal View History

2025-01-03 22:20:27 +04:00
{ config, pkgs, lib, ... }:
2025-01-03 22:15:17 +04:00
with lib;
2025-01-03 22:19:45 +04:00
let cfg = config.void.server.services.local.nextcloud;
2025-01-03 22:15:17 +04:00
in {
options.void.server.services.local.nextcloud = {
enable = mkEnableOption false;
};
config = mkIf cfg.enable {
# thank you again notashelf lmao
services = {
nextcloud = {
enable = true;
package = pkgs.nextcloud30;
https = true;
hostName = "nextcloud.sako.box";
nginx = { recommendedHttpHeaders = true; };
2025-01-03 23:15:54 +04:00
database.createLocally = true;
2025-01-03 22:15:17 +04:00
autoUpdateApps = {
enable = true;
startAt = "03:00";
};
caching = {
apcu = true;
memcached = true;
redis = true;
};
config = {
dbtype = "pgsql";
2025-01-03 23:05:12 +04:00
# SHUT UP
2025-01-12 00:34:20 +04:00
adminuser = "sako";
2025-01-03 23:05:12 +04:00
adminpassFile = "/srv/secrets/nextcloud/admin-temp-pass";
2025-01-03 22:15:17 +04:00
};
settings = {
2025-01-03 23:29:41 +04:00
# maintenance_window_start = 1;
2025-01-03 22:15:17 +04:00
trusted_domains = [ "https://nextcloud.sako.box" ];
trusted_proxies = [ "https://nextcloud.sako.box" ];
redis = {
2025-01-12 00:34:20 +04:00
host = "localhost:6372";
2025-01-03 22:15:17 +04:00
dbindex = 0;
timeout = 3;
};
default_phone_region = "AE";
lost_password_link = "disabled";
};
2025-01-03 23:29:41 +04:00
# phpOptions = {
# "opcache.enable" = "1";
# "opcache.enable_cli" = "1";
# "opcache.validate_timestamps" = "0";
# "opcache.save_comments" = "1";
2025-01-03 22:15:17 +04:00
2025-01-03 23:29:41 +04:00
# # <https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html>
# "opcache.jit" = "1255";
# "opcache.jit_buffer_size" = "256M";
2025-01-03 22:15:17 +04:00
2025-01-03 23:29:41 +04:00
# # fix the opcache "buffer is almost full" error in admin overview
# "opcache.interned_strings_buffer" = "16";
# # try to resolve delays in displaying content or incomplete page rendering
# "output_buffering" = "off";
2025-01-03 22:15:17 +04:00
2025-01-03 23:29:41 +04:00
# "pm" = "dynamic";
# "pm.max_children" = "50";
# "pm.start_servers" = "15";
# "pm.min_spare_servers" = "15";
# "pm.max_spare_servers" = "25";
# "pm.max_requests" = "500";
# };
2025-01-03 22:15:17 +04:00
};
nginx.virtualHosts."nextcloud.sako.box" = {
2025-01-03 23:25:06 +04:00
forceSSL = true;
2025-01-03 22:15:17 +04:00
sslCertificate = "/srv/secrets/certs/sako.box.pem";
sslCertificateKey = "/srv/secrets/certs/sako.box-key.pem";
};
};
2025-01-03 22:18:51 +04:00
systemd.services = {
phpfpm-nextcloud.aliases = [ "nextcloud.service" ];
"nextcloud-setup" = {
requires = [ "postgresql.service" "redis-nextcloud.service" ];
after = [ "postgresql.service" "redis-nextcloud.service" ];
serviceConfig = {
Restart = "on-failure";
RestartSec = "10s";
};
2025-01-03 22:15:17 +04:00
};
};
};
2025-01-03 22:18:51 +04:00
2025-01-03 22:15:17 +04:00
}