Update nextcloud service and configure for sops.

This commit is contained in:
Kevin Baensch 2023-09-10 15:29:51 +02:00
parent 08c9606679
commit c2aa9993ec
Signed by: derped
GPG key ID: C0F1D326C7626543

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, fn, ... }:
with lib;
@ -14,15 +14,15 @@ mkIf (elem "nextcloud" config.machine.services) {
hostName = domain;
https = true;
maxUploadSize = "1024M";
package = pkgs.nextcloud25;
package = pkgs.nextcloud27;
config = {
adminuser = mkDefault (elemAt cfg.administrators 0).name;
adminpassFile = "${cfg.secretPath}/nextcloud_admin";
adminpassFile = config.sops.secrets."services/nextcloud/adminPass".path;
dbtype = "mysql";
dbhost = "localhost";
dbport = "3306";
dbuser = "nextcloud";
dbpassFile = "${cfg.secretPath}/nextcloud_db";
dbpassFile = config.sops.secrets."services/nextcloud/dbPass".path;
dbname = "nextcloud";
dbtableprefix = "oc_";
extraTrustedDomains = cfg.extraDomains;
@ -49,17 +49,9 @@ mkIf (elem "nextcloud" config.machine.services) {
no-multicast-peers
'';
};
mysql = let
cfg = config.services.nextcloud.config;
in {
ensureDatabases = [ cfg.dbname ];
ensureUsers = [{
name = cfg.dbuser;
ensurePermissions = {
"${cfg.dbname}.*" = "ALL PRIVILEGES";
};
}];
};
};
sops.secrets = (fn.sopsHelper
(name: "services/nextcloud/${name}")
[ "adminPass" "dbPass" ]
{ owner = "nextcloud"; group = "nextcloud"; });
}