2022-12-11 18:35:42 +01:00
|
|
|
|
2023-01-03 16:57:39 +01:00
|
|
|
{ config, pkgs, ... }:
|
2022-12-11 18:35:42 +01:00
|
|
|
{
|
2023-08-27 19:04:20 +02:00
|
|
|
environment.systemPackages = with pkgs; [ # Default packages install system-wide
|
|
|
|
appimage-run
|
|
|
|
];
|
|
|
|
|
2022-12-11 18:35:42 +01:00
|
|
|
services.nextcloud = {
|
|
|
|
enable = true;
|
2023-01-06 19:30:22 +01:00
|
|
|
hostName = "cloud.kabtop.de";
|
2022-12-11 18:35:42 +01:00
|
|
|
https = true;
|
2024-06-08 14:48:57 +02:00
|
|
|
package = pkgs.nextcloud29;
|
2023-05-07 14:38:15 +02:00
|
|
|
database.createLocally = false;
|
2024-06-08 14:48:57 +02:00
|
|
|
notify_push.enable = true;
|
2023-05-13 11:07:29 +02:00
|
|
|
caching = {
|
|
|
|
redis = true;
|
|
|
|
apcu = false;
|
|
|
|
};
|
2024-06-08 14:48:57 +02:00
|
|
|
settings = {
|
|
|
|
log_type = "file";
|
2023-06-04 15:03:12 +02:00
|
|
|
logfile = "nextcloud.log";
|
2024-06-08 14:48:57 +02:00
|
|
|
overwriteprotocol = "https";
|
|
|
|
default_phone_region = "DE";
|
2024-06-08 16:04:00 +02:00
|
|
|
|
2023-05-13 11:07:29 +02:00
|
|
|
redis = {
|
|
|
|
host = "/run/redis-nextcloud/redis.sock";
|
|
|
|
port = 0;
|
|
|
|
};
|
|
|
|
"memcache.local" = "\\OC\\Memcache\\Redis";
|
|
|
|
"memcache.distributed" = "\\OC\\Memcache\\Redis";
|
|
|
|
"memcache.locking" = "\\OC\\Memcache\\Redis";
|
2024-06-08 16:04:00 +02:00
|
|
|
"maintenance_window_start" = "1";
|
2023-05-13 11:07:29 +02:00
|
|
|
};
|
2022-12-11 18:35:42 +01:00
|
|
|
config = {
|
|
|
|
dbtype = "pgsql";
|
|
|
|
dbuser = "nextcloud";
|
|
|
|
dbhost = "localhost";
|
|
|
|
dbname = "nextclouddb";
|
|
|
|
adminuser = "kabbone";
|
2022-12-27 09:25:23 +01:00
|
|
|
adminpassFile = config.age.secrets."services/nextcloud/adminpassFile".path;
|
|
|
|
dbpassFile = config.age.secrets."services/nextcloud/dbpassFile".path;
|
2022-12-11 18:35:42 +01:00
|
|
|
};
|
2023-01-03 16:14:25 +01:00
|
|
|
phpOptions = {
|
|
|
|
"opcache.interned_strings_buffer" = "16";
|
|
|
|
};
|
2022-12-31 19:02:57 +01:00
|
|
|
#autoUpdateApps.enable = true;
|
2022-12-11 18:35:42 +01:00
|
|
|
};
|
|
|
|
|
2024-01-13 11:52:57 +01:00
|
|
|
services.onlyoffice = {
|
|
|
|
enable = true;
|
2024-02-18 13:50:50 +01:00
|
|
|
hostname = "docs.cloud.kabtop.de";
|
2024-02-12 12:25:27 +01:00
|
|
|
postgresName = "onlyoffice";
|
2024-01-13 12:25:14 +01:00
|
|
|
postgresHost = "localhost";
|
|
|
|
postgresUser = "onlyoffice";
|
|
|
|
postgresPasswordFile = config.age.secrets."services/nextcloud/onlyofficedb".path;
|
2024-02-18 13:50:50 +01:00
|
|
|
jwtSecretFile = config.age.secrets."services/nextcloud/onlyofficejwt".path;
|
2024-01-13 11:52:57 +01:00
|
|
|
};
|
|
|
|
|
2024-01-06 11:37:25 +01:00
|
|
|
services.redis = {
|
2023-12-29 10:19:20 +01:00
|
|
|
vmOverCommit = true;
|
2024-01-06 11:37:25 +01:00
|
|
|
servers.nextcloud = {
|
|
|
|
enable = true;
|
|
|
|
user = "nextcloud";
|
|
|
|
port = 0;
|
|
|
|
};
|
2023-05-13 11:07:29 +02:00
|
|
|
};
|
|
|
|
|
2023-01-03 16:57:39 +01:00
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
virtualHosts = {
|
|
|
|
"${config.services.nextcloud.hostName}" = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
};
|
2024-10-05 10:31:29 +02:00
|
|
|
"${config.services.onlyoffice.hostname}" = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
};
|
2023-01-03 16:57:39 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-12-27 09:25:23 +01:00
|
|
|
age.secrets."services/nextcloud/dbpassFile" = {
|
|
|
|
file = ../../../secrets/services/nextcloud/dbpassFile.age;
|
|
|
|
owner = "nextcloud";
|
|
|
|
};
|
|
|
|
age.secrets."services/nextcloud/adminpassFile" = {
|
|
|
|
file = ../../../secrets/services/nextcloud/adminpassFile.age;
|
|
|
|
owner = "nextcloud";
|
|
|
|
};
|
2024-01-13 12:25:14 +01:00
|
|
|
age.secrets."services/nextcloud/onlyofficedb" = {
|
|
|
|
file = ../../../secrets/services/nextcloud/onlyofficedb.age;
|
|
|
|
owner = "onlyoffice";
|
|
|
|
};
|
2024-02-18 13:50:50 +01:00
|
|
|
age.secrets."services/nextcloud/onlyofficejwt" = {
|
|
|
|
file = ../../../secrets/services/nextcloud/onlyofficejwt.age;
|
|
|
|
owner = "onlyoffice";
|
|
|
|
};
|
2022-12-27 09:25:23 +01:00
|
|
|
|
2022-12-11 18:35:42 +01:00
|
|
|
systemd.services."nextcloud-setup" = {
|
|
|
|
requires = ["postgresql.service"];
|
|
|
|
after = ["postgresql.service"];
|
|
|
|
};
|
2024-02-12 12:25:27 +01:00
|
|
|
|
|
|
|
security.acme.defaults.email = "webmaster@kabtop.de";
|
|
|
|
security.acme.defaults.webroot = "/var/lib/acme/acme-challenge";
|
|
|
|
security.acme.acceptTerms = true;
|
|
|
|
|
2022-12-11 18:35:42 +01:00
|
|
|
}
|