move msmtp to dedicated file

This commit is contained in:
2026-06-20 20:42:28 -05:00
parent 4d3ef01876
commit ffaf77793f
3 changed files with 51 additions and 36 deletions
@@ -68,41 +68,5 @@ in {
# install userspace tools for smart # install userspace tools for smart
environment.systemPackages = with pkgs; [smartmontools]; environment.systemPackages = with pkgs; [smartmontools];
# mail test
services.mail.sendmailSetuidWrapper.enable = true;
programs.msmtp = {
enable = true;
setSendmail = true;
defaults = {
aliases = "/etc/aliases";
port = 587;
auth = "plain";
tls = "on";
tls_starttls = "on";
};
accounts.default = {
host = "smtp.mail.me.com";
user = "bdhelderman@icloud.com";
from = "alerts@blakedheld.xyz";
passwordeval = "/run/current-system/sw/bin/cat ${sec."email_pass".path}";
};
};
environment.etc.aliases.text = ''
root: me@blakedheld.xyz
blake: me@blakedheld.xyz
'';
sops.secrets = {
"email_pass" = {
owner = "blake";
group = "blake";
};
};
}; };
} }
+1
View File
@@ -9,6 +9,7 @@
./motd ./motd
./backups ./backups
./uptime-kuma ./uptime-kuma
./msmtp
#./postfix #./postfix
]; ];
} }
+50
View File
@@ -0,0 +1,50 @@
{
pkgs,
config,
lib,
...
}: let
service = "msmtp";
cfg = config.homelab.${service};
sec = config.sops.secrets;
in {
options.homelab.${service} = {
enable = lib.mkEnableOption "enables zfs";
};
config = lib.mkIf cfg.enable {
services.mail.sendmailSetuidWrapper.enable = true;
programs.${service} = {
enable = true;
setSendmail = true;
defaults = {
aliases = "/etc/aliases";
port = 587;
auth = "plain";
tls = "on";
tls_starttls = "on";
};
accounts.default = {
host = "smtp.mail.me.com";
user = "bdhelderman@icloud.com";
from = "alerts@blakedheld.xyz";
passwordeval = "/run/current-system/sw/bin/cat ${sec."email_pass".path}";
};
};
environment.etc.aliases.text = ''
root: me@blakedheld.xyz
blake: me@blakedheld.xyz
'';
sops.secrets = {
"email_pass" = {
owner = "blake";
group = "blake";
};
};
};
}