Update nextcloud service and configure for sops.
This commit is contained in:
parent
08c9606679
commit
c2aa9993ec
1 changed files with 8 additions and 16 deletions
|
@ -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"; });
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue