This commit is contained in:
commit
30ce0dafc2
195 changed files with 8902 additions and 0 deletions
37
services/forgejo/mail.nix
Normal file
37
services/forgejo/mail.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
sec,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (config.machine.forgejo) domain;
|
||||
address = "noreply@${domain}";
|
||||
in
|
||||
with lib; mkIf config.machine.mail.enable {
|
||||
services.forgejo = {
|
||||
secrets = {
|
||||
mailer.PASSWD = sec."mail/servicePassword".path;
|
||||
};
|
||||
settings.mailer = {
|
||||
ENABLED = true;
|
||||
FROM = address;
|
||||
USER = address;
|
||||
SMTP_ADDR = config.machine.mail.fqdn;
|
||||
SMTP_PORT = 465;
|
||||
PROTOCOL = "smtps";
|
||||
SENDMAIL_PATH = "${pkgs.system-sendmail}/bin/sendmail";
|
||||
SEND_AS_PLAIN_TEXT = true;
|
||||
};
|
||||
};
|
||||
|
||||
mailserver = {
|
||||
domains = [ domain ];
|
||||
accounts.${address} = {
|
||||
hashedPasswordFile = sec."mail/serviceHashedPassword".path;
|
||||
aliases = [ ];
|
||||
sendOnly = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue