Compare commits

...

1 Commits

Author SHA1 Message Date
Louis Pearson 540c4e6716 feat: Add configuration for nextcloud server 2023-12-29 22:24:27 -07:00
1 changed files with 70 additions and 0 deletions

View File

@ -127,6 +127,72 @@
};
};
services.nginx = {
enable = true;
# Use recommended settings
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
# Only allow PFS-enabled ciphers with AES256
sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
# Setup Nextcloud virtual host to listen on ports
virtualHosts = {
"nextcloud.samsehu.local" = {
# Force HTTP redirect to HTTPS
forceSSL = true;
# LetsEncrypt
enableACME = true;
};
};
};
services.nextcloud = {
enable = true;
hostName = "nextcloud.samsehu.local";
# Enable built-in virtual host management
# Takes care of somewhat complicated setup
nginx.enable = true;
# Use HTTPS for links
https = true;
autoUpdateApps.enable = true;
audoUpdateApps.startAt = "05:00:00";
config = {
overwriteProtocol = "https";
dbtype = "pgsql";
dbuser = "nextcloud";
dbhost = "/run/postgresql";
dbname = "nextcloud";
dbpassFile = "/var/nextcloud-db-pass";
adminpassFile = "/path/to/admin-pass-file";
adminuser = "admin";
};
};
services.postgresql = {
enable = true;
ensureDatabases = [ "nextcloud" ];
ensureUsers = [
{ name = "nextcloud";
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
}
];
};
systemd.services."nextcloud-setup" = {
requires = ["postgresql.service"];
after = ["postgresql.service"];
};
# ACME client service for configuring SSL certificate
security.acme = {
acceptTerms = true;
@ -158,6 +224,10 @@
# Blocky DNS
53
# Nextcloud / nginx
80
443
# Blocky API
4000