NixOS-Config/modules/system/services/server/fileserver/public/nextcloud/default.nix

46 lines
1.3 KiB
Nix

{ pkgs, config, ... }:
{
services = {
nextcloud = {
enable = true;
package = pkgs.nextcloud29;
hostName = "cloud.${config.secrets.jimDomain}";
datadir = "/mnt/nextcloud";
https = true;
config = {
adminuser = "jimbo";
adminpassFile = "/mnt/nextcloud/password.txt";
};
settings = {
trusted_proxies = [ "127.0.0.1" ];
trusted_domains = [ "cloud.${config.secrets.jimDomain}" ];
overwriteprotocol = "https";
mail_smtphost = "mx.${config.secrets.jimDomain}";
mail_domain = "${config.secrets.jimDomain}";
mail_from_address = "noreply";
mail_smtpauth = "true";
mail_smtpname = "noreply@${config.secrets.jimDomain}";
mail_smtppassword = config.secrets.noreplyPassword;
mail_smtpmode = "smtp";
mail_smtpport = 587;
};
};
nginx.virtualHosts."cloud.${config.secrets.jimDomain}" = {
enableACME = true;
addSSL = true;
locations."/" = {
proxyWebsockets = true;
extraConfig = "
location /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
";
};
};
};
}