nixos/services/nextcloud.nix

52 lines
1.3 KiB
Nix
Raw Normal View History

{ config, lib, ... }:
2019-02-26 13:44:40 +01:00
with lib;
mkIf (elem "nextcloud" config.machine.services) {
services = let
cfg = config.machine;
domain = (findFirst (s: s.service == "nextcloud") cfg cfg.vHosts).domain;
in {
nextcloud = {
enable = true;
home = "/var/lib/nextcloud";
hostName = domain;
https = true;
maxUploadSize = "1024M";
config = {
adminuser = "derped";
adminpassFile = "${cfg.secretPath}/nextcloud_admin";
dbtype = "mysql";
dbhost = "localhost";
dbport = "3306";
dbuser = "nextcloud";
dbpassFile = "${cfg.secretPath}/nextcloud_db";
dbname = "nextcloud";
dbtableprefix = "oc_";
2019-10-08 13:15:38 +02:00
extraTrustedDomains = cfg.extraDomains;
};
caching = {
apcu = true;
memcached = true;
redis = false;
};
2019-02-26 13:44:40 +01:00
};
# Turn Server used for nextcloud-talk
# This stuff is still untested.
coturn = mkIf (elem "nextcloud-talk" config.machine.services) {
# TLS is not needed as WebRTC is already encrypted.
enable = true;
realm = domain;
listening-port = 3478;
use-auth-secret = true;
extraConfig = ''
fingerprint
total-quota=100
bps-capacity=0
stale-nonce
no-multicast-peers
'';
2019-02-26 13:44:40 +01:00
};
};
}