nixos-config/config/services/nextcloud.nix

93 lines
2.3 KiB
Nix
Raw Normal View History

2023-04-18 07:55:45 +00:00
{
pkgs,
config,
...
}: {
services.nextcloud = {
2023-04-23 17:35:42 +00:00
appstoreEnable = true;
2023-04-18 08:37:06 +00:00
caching.redis = true;
2023-04-18 08:25:28 +00:00
config = {
adminpassFile = config.sops.secrets."services/nextcloud/adminpass".path;
adminuser = "darkkirb";
dbhost = "/run/postgresql";
dbname = "nextcloud";
dbtype = "pgsql";
dbuser = "nextcloud";
defaultPhoneRegion = "DE";
objectstore.s3 = {
2023-04-18 11:39:45 +00:00
autocreate = false;
2023-04-18 08:25:28 +00:00
bucket = "nextcloud-chir-rs";
enable = true;
2023-10-01 14:47:26 +00:00
hostname = "ams1.vultrobjects.com";
key = "X86D3HKJ3Y92IASK0XIG";
2023-04-18 08:25:28 +00:00
secretFile = config.sops.secrets."services/nextcloud/s3".path;
usePathStyle = true;
useSsl = true;
};
overwriteProtocol = "https";
2023-04-18 07:55:45 +00:00
};
enable = true;
enableImagemagick = true;
extraAppsEnable = true;
2023-04-18 08:37:06 +00:00
extraOptions = {
2023-04-18 07:55:45 +00:00
redis = {
host = config.services.redis.servers.nextcloud.unixSocket;
port = 0;
dbindex = 0;
};
};
2023-04-18 08:37:06 +00:00
hostName = "cloud.chir.rs";
2023-04-18 07:55:45 +00:00
https = true;
2023-12-22 17:00:14 +00:00
package = pkgs.nextcloud28;
2023-04-18 07:55:45 +00:00
phpOptions = {
2023-04-18 11:21:53 +00:00
"opcache.save_comments" = "1";
"opcache.validate_timestamps" = "0";
"opcache.jit" = "1255";
2023-04-18 07:55:45 +00:00
"opcache.jit_buffer_size" = "128M";
};
poolSettings = {
2023-04-18 12:30:56 +00:00
pm = "dynamic";
2023-04-18 07:55:45 +00:00
"pm.max_children" = 460;
2023-04-18 12:30:56 +00:00
"pm.start_servers" = 4;
"pm.min_spare_servers" = 4;
"pm.max_spare_servers" = 64;
2023-04-18 07:55:45 +00:00
};
webfinger = true;
};
sops.secrets."services/nextcloud/adminpass".owner = "nextcloud";
sops.secrets."services/nextcloud/s3".owner = "nextcloud";
services.redis.servers.nextcloud = {
enable = true;
user = "nextcloud";
};
services.postgresql.ensureDatabases = ["nextcloud"];
services.postgresql.ensureUsers = [
{
name = "nextcloud";
ensurePermissions = {
"DATABASE attic" = "ALL PRIVILEGES";
2023-04-18 07:55:45 +00:00
};
}
];
services.nginx.virtualHosts.${config.services.nextcloud.hostName} = {
listen = [
{
2023-04-18 11:34:53 +00:00
addr = "127.0.0.1";
2023-04-18 07:55:45 +00:00
port = 13286;
}
];
};
services.caddy.virtualHosts."cloud.chir.rs" = {
useACMEHost = "chir.rs";
logFormat = pkgs.lib.mkForce "";
extraConfig = ''
import baseConfig
reverse_proxy {
to http://127.0.0.1:13286
2023-04-18 12:33:12 +00:00
header_up Host cloud.chir.rs
2023-04-18 07:55:45 +00:00
}
'';
};
}