NixOS-Config/nixos/server/nextcloud.nix

46 lines
1.3 KiB
Nix
Raw Normal View History

{pkgs, outputs, ...}: {
services = {
nextcloud = {
enable = true;
package = pkgs.nextcloud29;
hostName = "cloud.${outputs.secrets.jimDomain}";
datadir = "/mnt/nextcloud";
https = true;
config = {
adminuser = "jimbo";
2024-09-10 21:39:12 -04:00
adminpassFile = pkgs.writeText "nextpass" outputs.secrets.nextcloudPass;
};
settings = {
trusted_proxies = [ "127.0.0.1" ];
trusted_domains = [ "cloud.${outputs.secrets.jimDomain}" ];
overwriteprotocol = "https";
2024-08-24 22:16:51 -04:00
# 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;
}
";
};
2024-08-24 22:16:51 -04:00
};
};
}