era-configuration-nix/mail.nix

64 lines
1.8 KiB
Nix
Raw Normal View History

2017-03-11 15:15:13 +01:00
# Mail stack:
2017-03-18 13:58:50 +01:00
# Display maildirs and read emails -> neomutt
# Write emails -> vim (should already be there)
2017-05-11 12:35:47 +02:00
# Receive emails & synchronize maildir -> mbsync (isync)
2017-03-18 13:58:50 +01:00
# Submit emails to send -> msmtp
# Deal with MIME encoded email packages -> ripmime
# Display HTML emails -> w3m
# Search maildirs -> mu
2017-05-11 12:35:47 +02:00
# Send encrypted email -> gpupg1orig
2017-03-11 15:15:13 +01:00
# and various automation provided by systemd
{ config, pkgs, ... }:
let mu-light = (pkgs.mu.override { withMug = false; }); # no webkit dependency
in
2017-03-11 15:15:13 +01:00
{
environment.systemPackages = with pkgs; [
msmtp
neomutt
ripmime
mu-light
2017-03-11 15:15:13 +01:00
w3m
2017-05-11 12:35:47 +02:00
isync
gnupg1orig
2017-03-11 15:15:13 +01:00
];
systemd.user.services = {
2017-05-11 12:35:47 +02:00
mbsync = {
description = "IMAP mailbox sync";
path = [ pkgs.isync ];
script = "mbsync -c /home/eeva/.mutt/mbsyncrc -q -a";
startAt = "*:0/3";
wantedBy = [ "timers.target" ];
serviceConfig = {
TimeoutStartSec = "2min";
};
preStart = ''
mkdir -p /home/eeva/mail/EEVA
mkdir -p /home/eeva/mail/MPO
mkdir -p /home/eeva/mail/LACL
'';
};
2017-03-11 15:15:13 +01:00
mu = {
description = "Updating mail database";
path = [ mu-light ];
script = "mu index --quiet -m ~/mail";
2017-03-11 15:15:13 +01:00
startAt = "daily";
wantedBy = [ "timers.target" ];
};
msmtp-runqueue = {
description = "Flushing mail queue";
script = builtins.readFile "/home/eeva/prefix/bin/msmtp-runqueue";
preStart = "mkdir -p /home/eeva/.msmtpqueue";
2017-05-11 12:35:47 +02:00
postStop = "rm -f /home/eeva/.msmtpqueue/.lock";
startAt = "*:0/10";
serviceConfig = {
2017-05-11 12:35:47 +02:00
TimeoutStartSec = "2min";
};
path = [ pkgs.msmtp ];
};
};
2017-03-11 15:15:13 +01:00
}