NixOS-Config/nixos/server/nextcloud.nix
2024-09-10 21:43:17 -04:00

46 lines
1.4 KiB
Nix

{pkgs, outputs, ...}: {
services = {
nextcloud = {
enable = true;
package = pkgs.nextcloud29;
hostName = "cloud.${outputs.secrets.jimDomain}";
datadir = "/mnt/nextcloud";
https = true;
config = {
adminuser = "jimbo";
adminpassFile = "${pkgs.writeText "nextpass" outputs.secrets.nextcloudPass}";
};
settings = {
trusted_proxies = [ "127.0.0.1" ];
trusted_domains = [ "cloud.${outputs.secrets.jimDomain}" ];
overwriteprotocol = "https";
# Mailserver settings
mail_smtphost = "mx.${outputs.secrets.jimDomain}";
mail_domain = "${outputs.secrets.jimDomain}";
mail_from_address = "noreply";
mail_smtpauth = "true";
mail_smtpname = "noreply@${outputs.secrets.jimDomain}";
mail_smtppassword = outputs.secrets.noreplyPassword;
mail_smtpmode = "smtp";
mail_smtpport = 587;
};
};
nginx.virtualHosts."cloud.${outputs.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;
}
";
};
};
};
}