nix-configs/hosts/schrottserver/nextcloud.nix

39 lines
988 B
Nix
Raw Normal View History

2023-02-04 00:14:39 +00:00
{ pkgs, ... }:
{
services.nextcloud = {
enable = true;
config = {
dbtype = "pgsql";
dbuser = "nextcloud";
dbhost = "/run/postgresql"; # nextcloud will add /.s.PGSQL.5432 by itself
dbname = "nextcloud";
adminpassFile = "${../secret-data/nextcloud-admin-pass}";
adminuser = "root";
};
package = pkgs.nextcloud25;
extraApps = with pkgs.nextcloud25Packages.apps; {
inherit bookmarks calendar contacts news tasks;
2023-02-04 00:14:39 +00:00
};
extraAppsEnable = true;
hostName = "wolke.schrottkatze.de";
https = true;
};
services.postgresql = {
enable = true;
ensureDatabases = [ "nextcloud" ];
ensureUsers = [
2023-02-09 10:26:17 +00:00
{
name = "nextcloud";
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
}
2023-02-04 00:14:39 +00:00
];
};
# ensure that postgres is running *before* running the setup
systemd.services."nextcloud-setup" = {
requires = ["postgresql.service"];
after = ["postgresql.service"];
};
}