2022-10-12 18:04:06 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (pkgs) fetchNextcloudApp;
|
|
|
|
nextcloud = pkgs.nextcloud23;
|
|
|
|
hostName = "nextcloud.${config.services.nginx.domain}";
|
|
|
|
in {
|
|
|
|
services.nextcloud = {
|
|
|
|
inherit hostName;
|
|
|
|
|
|
|
|
package = nextcloud;
|
|
|
|
enable = true;
|
|
|
|
maxUploadSize = "2G";
|
|
|
|
https = true;
|
|
|
|
|
|
|
|
config = {
|
|
|
|
overwriteProtocol = "https";
|
|
|
|
|
|
|
|
dbtype = "pgsql";
|
|
|
|
dbhost = "/run/postgresql";
|
|
|
|
|
|
|
|
adminuser = "tlater";
|
|
|
|
adminpassFile = config.sops.secrets."nextcloud/tlater".path;
|
|
|
|
|
|
|
|
defaultPhoneRegion = "AT";
|
2021-04-12 01:42:46 +01:00
|
|
|
};
|
2022-10-12 18:04:06 +01:00
|
|
|
|
|
|
|
# TODO(tlater): Add redis config. This will be much easier
|
|
|
|
# starting with 22.11, since this will add an `extraOptions` where
|
|
|
|
# the necessary redis config can go.
|
|
|
|
};
|
|
|
|
|
|
|
|
# Ensure that this service doesn't start before postgres is ready
|
|
|
|
systemd.services.nextcloud-setup.after = ["postgresql.service"];
|
|
|
|
|
|
|
|
# Set up SSL
|
|
|
|
services.nginx.virtualHosts."${hostName}" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
2021-04-12 01:42:46 +01:00
|
|
|
};
|
|
|
|
}
|