nix/container/Cloud.nix

47 lines
1.2 KiB
Nix
Raw Normal View History

2024-06-14 02:58:39 +03:00
{ container, pkgs, ... } @args: let
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" = {
hostPath = "${cfg.storage}/data";
isReadOnly = false;
};
};
2024-06-14 02:58:39 +03:00
config = { config, ... }: container.mkContainerConfig cfg {
environment.systemPackages = [ pkgs.postgresql ];
services.nextcloud = {
enable = true;
2024-06-09 23:35:53 +03:00
# package = pkgs.nextcloud29;
hostName = cfg.domain;
2024-06-09 23:35:53 +03:00
# phpOptions = {
# memory_limit = lib.mkForce "20G";
# };
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"}";
dbtype = "pgsql";
dbuser = "nextcloud";
};
extraApps = {
2024-06-09 23:35:53 +03:00
inherit (config.services.nextcloud.package.packages.apps) contacts calendar onlyoffice;
};
extraAppsEnable = true;
settings = {
trusted_domains = [ cfg.address ];
trusted_proxies = [ container.config.proxy.address ];
};
};
};
};
}