2024-03-01 22:15:55 +01:00
|
|
|
{ self, config, lib, pkgs, ... }:
|
2024-04-03 12:59:00 +02:00
|
|
|
let
|
|
|
|
domain = "cloud.sondell.org";
|
|
|
|
nextcloud = pkgs.nextcloud28;
|
2024-03-01 22:15:55 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
|
2024-04-03 12:59:00 +02:00
|
|
|
environment.systemPackages = [
|
|
|
|
nextcloud
|
|
|
|
];
|
2024-03-01 22:15:55 +01:00
|
|
|
services = {
|
|
|
|
nginx.virtualHosts = {
|
|
|
|
${domain} = {
|
2024-04-02 19:25:00 +02:00
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
2024-03-01 22:15:55 +01:00
|
|
|
# Use DNS Challenege.
|
|
|
|
# acmeRoot = null;
|
|
|
|
};
|
|
|
|
};
|
2024-03-02 17:32:59 +01:00
|
|
|
postgresql.enable = true;
|
2024-03-01 22:15:55 +01:00
|
|
|
#
|
|
|
|
nextcloud = {
|
|
|
|
enable = true;
|
|
|
|
hostName = domain;
|
|
|
|
# Need to manually increment with every major upgrade.
|
2024-04-03 12:59:00 +02:00
|
|
|
package = nextcloud;
|
2024-03-01 22:15:55 +01:00
|
|
|
# Let NixOS install and configure the database automatically.
|
|
|
|
database.createLocally = true;
|
|
|
|
# Increase the maximum file upload size.
|
|
|
|
maxUploadSize = "16G";
|
|
|
|
https = true;
|
|
|
|
autoUpdateApps.enable = true;
|
|
|
|
extraAppsEnable = true;
|
2024-04-03 12:59:00 +02:00
|
|
|
# Let NixOS install and configure Redis caching automatically.
|
|
|
|
configureRedis = true;
|
|
|
|
settings = {
|
|
|
|
maintenance_window_start = 1;
|
|
|
|
};
|
2024-03-27 15:30:23 +01:00
|
|
|
extraOptions = {
|
2024-04-03 12:59:00 +02:00
|
|
|
# redis = {
|
|
|
|
# # host = "/run/redis/redis.sock";
|
|
|
|
# port = 0;
|
|
|
|
# dbindex = 0;
|
|
|
|
# password = "secret";
|
|
|
|
# timeout = 1.5;
|
|
|
|
# };
|
2024-03-27 15:30:23 +01:00
|
|
|
};
|
2024-03-01 22:15:55 +01:00
|
|
|
extraApps = with config.services.nextcloud.package.packages.apps; {
|
|
|
|
# List of apps we want to install and are already packaged in
|
|
|
|
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/nextcloud/packages/nextcloud-apps.json
|
|
|
|
inherit mail calendar contacts notes onlyoffice tasks cookbook;
|
|
|
|
};
|
|
|
|
config = {
|
|
|
|
overwriteProtocol = "https";
|
2024-04-03 12:59:00 +02:00
|
|
|
defaultPhoneRegion = "SE";
|
2024-03-01 22:15:55 +01:00
|
|
|
dbtype = "pgsql";
|
|
|
|
adminuser = "admin";
|
|
|
|
adminpassFile = "/etc/nixos/.secrets/nextadminpw";
|
|
|
|
};
|
|
|
|
# Suggested by Nextcloud's health check.
|
|
|
|
phpOptions."opcache.interned_strings_buffer" = "16";
|
|
|
|
};
|
|
|
|
# Nightly database backups.
|
|
|
|
# postgresqlBackup = {
|
|
|
|
# enable = true;
|
|
|
|
# startAt = "*-*-* 01:15:00";
|
|
|
|
# };
|
|
|
|
};
|
2024-04-03 12:59:00 +02:00
|
|
|
# services.onlyoffice = {
|
|
|
|
# enable = true;
|
|
|
|
# port = 8123;
|
|
|
|
# };
|
|
|
|
# services.nginx.virtualHosts."office.sondell.org" = {
|
|
|
|
# forceSSL = true;
|
|
|
|
# enableACME = true;
|
|
|
|
# locations."/".proxyPass = "http://localhost:8123";
|
|
|
|
|
|
|
|
# };
|
2024-03-01 22:15:55 +01:00
|
|
|
}
|