add next-cloud

This commit is contained in:
Leon Vita 2022-09-28 17:55:57 +01:00
parent 90f7ffadf9
commit 54da79468b
1 changed files with 34 additions and 0 deletions

View File

@ -77,6 +77,40 @@
];
};
};
#------------------End----------------------------
#------------------next-cloud---------------------
services.nextcloud = {
enable = true;
hostName = "next-cloud";
config = {
dbtype = "pgsql";
dbuser = "nextcloud";
dbhost = "/run/postgresql"; # nextcloud will add /.s.PGSQL.5432 by itself
dbname = "nextcloud";
adminpassFile = "/etc/nixos/next-cloud/pass";
adminuser = "root";
extraTrustedDomains = [ "172.20.79.254" "10.10.11.4" ];
};
};
services.postgresql = {
enable = true;
ensureDatabases = [ "nextcloud" ];
ensureUsers = [
{ name = "nextcloud";
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
}
];
};
# ensure that postgres is running *before* running the setup
systemd.services."nextcloud-setup" = {
requires = ["postgresql.service"];
after = ["postgresql.service"];
};
#------------------End----------------------------
system.stateVersion = "22.05";
}