add: nextcloud

master
root 2020-08-10 16:26:36 +00:00
parent 543a384a52
commit a1382168cc
1 changed files with 31 additions and 1 deletions

View File

@ -64,8 +64,38 @@
};
};
services.nextcloud = {
enable = true;
hostName = "nextcloud." + config.networking.hostName;
nginx.enable = true;
config = {
dbtype = "pgsql";
dbuser = "nextcloud";
dbhost = "/run/postgresql";
dbname = "nextcloud";
adminpassFile = "/var/lib/nextcloud/config/adminpass";
adminuser = "root";
};
};
services.postgresql = {
enable = true;
ensureDatabases = [ "nextcloud" ];
ensureUsers = [
{ name = "nextcloud";
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
}
];
};
# ensure that postgres is running *before* running the nextcloud setup
systemd.services."nextcloud-setup" = {
requires = [ "postgresql.service" ];
after = [ "postgresql.service" ];
};
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ 22 80 ];
networking.firewall.allowedTCPPorts = [ 22 80 443 ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;