mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-05 15:00:14 +00:00
auto-upgrades and notify using email
This commit is contained in:
@ -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} ${
|
||||
|
32
modules/common/mail/system.nix
Normal file
32
modules/common/mail/system.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user