2024-02-29 14:53:34 +00:00
|
|
|
# See https://nixos.wiki/wiki/Msmtp
|
2024-05-16 16:19:04 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
nix-secrets,
|
|
|
|
...
|
|
|
|
}:
|
2024-02-29 14:53:34 +00:00
|
|
|
|
|
|
|
let
|
2024-05-07 22:02:59 +00:00
|
|
|
cfg = config.host.services.msmtp;
|
2024-02-29 14:53:34 +00:00
|
|
|
in
|
|
|
|
with lib;
|
|
|
|
{
|
2024-05-07 22:02:59 +00:00
|
|
|
options = {
|
|
|
|
host.services.msmtp.enable = mkEnableOption (mdDoc "Enables mail server");
|
|
|
|
};
|
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 = {
|
|
|
|
host = nix-secrets.services.msmtp.host;
|
|
|
|
user = nix-secrets.services.msmtp.user;
|
|
|
|
password = nix-secrets.services.msmtp.password;
|
|
|
|
auth = true;
|
|
|
|
tls = true;
|
|
|
|
tls_starttls = true;
|
|
|
|
port = 587;
|
|
|
|
from = "${config.networking.hostName}@${nix-secrets.networking.primaryDomain}";
|
|
|
|
to = nix-secrets.users.aires.email;
|
|
|
|
};
|
2024-05-07 22:02:59 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|