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

29 lines
731 B
Nix
Raw Normal View History

# See https://wiki.nixos.org/wiki/Msmtp
{ config, lib, ... }:
2024-02-29 09:53:34 -05:00
let
cfg = config.aux.system.services.msmtp;
2024-02-29 09:53:34 -05:00
in
{
options = {
2024-08-02 17:55:48 -04:00
aux.system.services.msmtp.enable = lib.mkEnableOption "Enables mail server";
};
2024-02-29 09:53:34 -05:00
2024-08-02 17:55:48 -04:00
config = lib.mkIf cfg.enable {
programs.msmtp = {
enable = true;
2024-05-16 12:19:04 -04:00
accounts.default = {
2024-06-24 12:24:21 -04:00
host = config.secrets.services.msmtp.host;
user = config.secrets.services.msmtp.user;
password = config.secrets.services.msmtp.password;
2024-05-16 12:19:04 -04: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 12:19:04 -04:00
};
};
};
}