2024-06-14 02:58:39 +03:00
|
|
|
{ container, pkgs, ... } @args: let
|
2024-06-01 10:37:49 +03:00
|
|
|
cfg = container.config.cloud;
|
|
|
|
in {
|
|
|
|
systemd.tmpfiles.rules = container.mkContainerDir cfg [
|
|
|
|
"data"
|
|
|
|
];
|
|
|
|
|
|
|
|
containers.cloud = container.mkContainer cfg {
|
|
|
|
bindMounts = {
|
2024-06-13 17:00:05 +03:00
|
|
|
"/var/lib/nextcloud" = {
|
2024-06-01 10:37:49 +03:00
|
|
|
hostPath = "${cfg.storage}/data";
|
|
|
|
isReadOnly = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-06-14 02:58:39 +03:00
|
|
|
config = { config, ... }: container.mkContainerConfig cfg {
|
2024-06-01 10:37:49 +03:00
|
|
|
environment.systemPackages = [ pkgs.postgresql ];
|
|
|
|
services.nextcloud = {
|
|
|
|
enable = true;
|
2024-06-09 23:35:53 +03:00
|
|
|
# package = pkgs.nextcloud29;
|
2024-06-01 10:37:49 +03:00
|
|
|
hostName = cfg.domain;
|
2024-06-09 23:35:53 +03:00
|
|
|
# phpOptions = {
|
|
|
|
# memory_limit = lib.mkForce "20G";
|
|
|
|
# };
|
2024-06-01 10:37:49 +03:00
|
|
|
config = {
|
|
|
|
adminuser = "root";
|
|
|
|
adminpassFile = "${pkgs.writeText "NextcloudPassword" "root"}";
|
|
|
|
|
|
|
|
dbhost = container.config.postgres.address;
|
|
|
|
dbname = "nextcloud";
|
2024-06-09 23:35:53 +03:00
|
|
|
dbpassFile = "${pkgs.writeText "NextcloudDbPassword" "nextcloud"}";
|
2024-06-01 10:37:49 +03:00
|
|
|
dbtype = "pgsql";
|
|
|
|
dbuser = "nextcloud";
|
|
|
|
};
|
|
|
|
extraApps = {
|
2024-06-09 23:35:53 +03:00
|
|
|
inherit (config.services.nextcloud.package.packages.apps) contacts calendar onlyoffice;
|
2024-06-01 10:37:49 +03:00
|
|
|
};
|
|
|
|
extraAppsEnable = true;
|
|
|
|
settings = {
|
2024-06-20 15:26:15 +03:00
|
|
|
trusted_domains = [ cfg.address cfg.domain ];
|
2024-06-01 10:37:49 +03:00
|
|
|
trusted_proxies = [ container.config.proxy.address ];
|
2024-06-20 15:26:15 +03:00
|
|
|
allow_local_remote_servers = true;
|
2024-06-01 10:37:49 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|