2025-06-01 22:39:20 +08:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
{
|
|
|
|
|
services.nextcloud = {
|
|
|
|
|
enable = true;
|
|
|
|
|
configureRedis = true;
|
|
|
|
|
package = pkgs.nextcloud31;
|
|
|
|
|
hostName = "nextcloud.knossos";
|
|
|
|
|
datadir = "/var/lib/nextcloud/";
|
|
|
|
|
settings = {
|
|
|
|
|
overwriteprotocol = "https";
|
|
|
|
|
trusted_proxies = [ "localhost" "127.0.0.1" "100.82.24.89" ];
|
|
|
|
|
trusted_domains = [ "nextcloud.knossos.arkadi.one" ];
|
|
|
|
|
};
|
|
|
|
|
config = {
|
|
|
|
|
dbtype = "pgsql";
|
|
|
|
|
dbuser = "nextcloud";
|
|
|
|
|
dbhost = "/run/postgresql"; # nextcloud will add /.s.PGSQL.5432 by itself
|
|
|
|
|
dbname = "nextcloud";
|
2025-11-06 19:49:17 +08:00
|
|
|
adminpassFile = "/var/lib/secrets/nextcloud/nextcloud-admin-pass";
|
2025-06-01 22:39:20 +08:00
|
|
|
adminuser = "admin";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2025-11-06 19:49:17 +08:00
|
|
|
services.postgresql = {
|
2025-06-01 22:39:20 +08:00
|
|
|
enable = true;
|
|
|
|
|
ensureDatabases = [ "nextcloud" ];
|
|
|
|
|
ensureUsers = [
|
|
|
|
|
{ name = "nextcloud";
|
|
|
|
|
ensureDBOwnership = true;
|
|
|
|
|
}
|
|
|
|
|
];
|
2025-11-06 19:49:17 +08:00
|
|
|
};
|
2025-06-01 22:39:20 +08:00
|
|
|
|
2025-11-06 19:49:17 +08:00
|
|
|
# ensure that postgres is running *before* running the setup
|
|
|
|
|
systemd.services."nextcloud-setup" = {
|
2025-06-01 22:39:20 +08:00
|
|
|
requires = ["postgresql.service"];
|
|
|
|
|
after = ["postgresql.service"];
|
2025-11-06 19:49:17 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# CALIBRE-WEB already disabled?
|
2025-06-01 22:39:20 +08:00
|
|
|
|
2025-11-06 19:49:17 +08:00
|
|
|
# services.nginx.enable = true;
|
|
|
|
|
# services.nginx.virtualHosts."nextcloud.knossos" ={
|
|
|
|
|
# listen = [ { addr = "127.0.0.1"; port = 8009; } ];
|
|
|
|
|
# forceSSL = false;
|
|
|
|
|
# };
|
2025-06-01 22:39:20 +08:00
|
|
|
|
|
|
|
|
}
|