1
0
Fork 0
nix-configuration/modules/services/msmtp.nix

30 lines
725 B
Nix
Raw Normal View History

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