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

29 lines
731 B
Nix

# See https://wiki.nixos.org/wiki/Msmtp
{ config, lib, ... }:
let
cfg = config.aux.system.services.msmtp;
in
{
options = {
aux.system.services.msmtp.enable = lib.mkEnableOption "Enables mail server";
};
config = lib.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;
};
};
};
}