auto-upgrades and notify using email

This commit is contained in:
Noah Masur
2023-07-28 23:28:08 -04:00
parent 9c2e004c8b
commit 38892b1135
4 changed files with 82 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ config, pkgs, lib, ... }: {
imports = [ ./himalaya.nix ./aerc.nix ];
imports = [ ./himalaya.nix ./aerc.nix ./system.nix ];
options = {
mail.enable = lib.mkEnableOption "Mail service.";
@ -78,7 +78,6 @@
CopyArrivalDate = "yes"; # Sync time of original message
};
};
msmtp.enable = true;
notmuch.enable = true;
passwordCommand =
"${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${

View File

@ -0,0 +1,32 @@
{ config, pkgs, lib, ... }: {
config = lib.mkIf (config.mail.enable || config.server) {
home-manager.users.${config.user} = {
programs.msmtp.enable = true;
accounts.email.accounts.system =
let address = "system@${config.mail.server}";
in {
userName = address;
realName = "NixOS System";
primary = false;
inherit address;
passwordCommand =
"${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${
pkgs.writeText "mailpass-system.age"
(builtins.readFile ../../../private/mailpass-system.age)
}";
msmtp.enable = true;
smtp = {
host = config.mail.smtpHost;
port = 465;
tls.enable = true;
};
};
};
};
}