fix nextcloud mail config

This commit is contained in:
2023-10-04 16:14:25 +08:00
parent 6020e071c0
commit 7fb51ba080
3 changed files with 20 additions and 6 deletions

6
flake.lock generated
View File

@@ -942,11 +942,11 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1696404520,
"narHash": "sha256-OR8YPNHgyP5xKXRDPtsilUYPlIYlFfyhgsesVBONwdk=",
"lastModified": 1696406292,
"narHash": "sha256-XgLBlpKm0Lv62v9ylP/6mlxpb2mnWk5cnnJONmX/vsA=",
"owner": "CHN-beta",
"repo": "nixpkgs",
"rev": "a4df0ace81f343d43cb14e6d6c0c116befa69d8a",
"rev": "60efae979503a7eed6ee896aa0bcff5037d3f81d",
"type": "github"
},
"original": {

View File

@@ -32,6 +32,16 @@ inputs:
defaultPhoneRegion = "CN";
};
configureRedis = true;
extraOptions =
{
mail_domain = "chn.moe";
mail_from_address = "nextcloud";
mail_smtphost = "mail.chn.moe";
mail_smtpport = 465;
mail_smtpsecure = "ssl";
mail_smtpauth = true;
mail_smtpname = "bot@chn.moe";
};
secretFile = inputs.config.sops.templates."nextcloud/secret".path;
};
nixos.services =
@@ -43,7 +53,11 @@ inputs:
{
templates."nextcloud/secret" =
{
content = toJSON { redis.password = inputs.config.sops.placeholder."redis/nextcloud"; };
content = toJSON
{
redis.password = inputs.config.sops.placeholder."redis/nextcloud";
mail_smtppassword = inputs.config.sops.placeholder."mail/bot";
};
owner = inputs.config.users.users.nextcloud.name;
};
secrets =

View File

@@ -5,7 +5,7 @@ inputs:
type = types.attrsOf (types.submodule (submoduleInputs: { options =
{
hostname = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
# upstream = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
upstream = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
};}));
default = {};
};
@@ -26,7 +26,7 @@ inputs:
(instance:
{
name = instance.value.hostname;
value = inputs.config.services.nextcloud.nginx.recommendedConfig;
value = inputs.config.services.nextcloud.nginx.recommendedConfig { inherit (instance.value) upstream; };
})
(attrsToList instances));
}