1
0
Fork 0
nix-configuration/modules/services/msmtp.nix
2024-06-24 12:35:45 -04:00

30 lines
737 B
Nix

# See https://nixos.wiki/wiki/Msmtp
{ config, lib, ... }:
let
cfg = config.aux.system.services.msmtp;
in
with lib;
{
options = {
aux.system.services.msmtp.enable = mkEnableOption (mdDoc "Enables mail server");
};
config = mkIf cfg.enable {
programs.msmtp = {
enable = true;
accounts.default = {
host = config.secrets.services.msmtp.host;
user = config.secrets.services.msmtp.user;
password = config.secrets.services.msmtp.password;
auth = true;
tls = true;
tls_starttls = true;
port = 587;
from = "${config.networking.hostName}@${config.secrets.networking.primaryDomain}";
to = config.secrets.users.aires.email;
};
};
};
}