2024-02-29 14:53:34 +00:00
|
|
|
# See https://nixos.wiki/wiki/Msmtp
|
2024-05-16 17:35:11 +00:00
|
|
|
{ config, lib, ... }:
|
2024-02-29 14:53:34 +00:00
|
|
|
|
|
|
|
let
|
2024-06-24 15:38:28 +00:00
|
|
|
cfg = config.aux.system.services.msmtp;
|
2024-02-29 14:53:34 +00:00
|
|
|
in
|
|
|
|
with lib;
|
|
|
|
{
|
2024-05-07 22:02:59 +00:00
|
|
|
options = {
|
2024-06-24 15:38:28 +00:00
|
|
|
aux.system.services.msmtp.enable = mkEnableOption (mdDoc "Enables mail server");
|
2024-05-07 22:02:59 +00:00
|
|
|
};
|
2024-02-29 14:53:34 +00:00
|
|
|
|
2024-05-07 22:02:59 +00:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
programs.msmtp = {
|
|
|
|
enable = true;
|
2024-05-16 16:19:04 +00:00
|
|
|
accounts.default = {
|
2024-06-24 16:24:21 +00:00
|
|
|
host = config.secrets.services.msmtp.host;
|
2024-05-16 17:35:11 +00:00
|
|
|
user = config.secrets.services.msmtp.user;
|
|
|
|
password = config.secrets.services.msmtp.password;
|
2024-05-16 16:19:04 +00:00
|
|
|
auth = true;
|
|
|
|
tls = true;
|
|
|
|
tls_starttls = true;
|
|
|
|
port = 587;
|
2024-05-16 17:35:11 +00:00
|
|
|
from = "${config.networking.hostName}@${config.secrets.networking.primaryDomain}";
|
|
|
|
to = config.secrets.users.aires.email;
|
2024-05-16 16:19:04 +00:00
|
|
|
};
|
2024-05-07 22:02:59 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|