Skip to content

Instantly share code, notes, and snippets.

@CRTified
Created July 5, 2020 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CRTified/1b2dd623d48931ff584d237576531ab9 to your computer and use it in GitHub Desktop.
Save CRTified/1b2dd623d48931ff584d237576531ab9 to your computer and use it in GitHub Desktop.
{
services.postgresql = {
enable = true;
ensureDatabases = [ "nextcloud" ];
ensureUsers = [
{ name = "nextcloud";
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
}
];
};
services.nextcloud = {
enable = true;
package = pkgs.nextcloud18;
config = {
adminpassFile = "/var/lib/nextcloud/admin.txt";
adminuser = "admin";
extraTrustedDomains = [ "example.org" ];
trustedProxies = [ "192.168.101.10" ];
overwriteProtocol = "https";
dbtype = "pgsql";
dbuser = "nextcloud";
dbhost = "/run/postgresql"; # nextcloud will add /.s.PGSQL.5432 by itself
dbname = "nextcloud";
};
hostName = "example.org";
https = false; # HTTPS is added in the reverse proxy
maxUploadSize = "5G";
nginx.enable = true;
};
systemd.services."nextcloud-setup" = {
requires = ["postgresql.service"];
after = ["postgresql.service"];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment