add mailfetch service

This commit is contained in:
Felix Suchert 2024-10-24 11:47:20 -04:00
parent 132dbd6701
commit fc183208cf
Signed by: feliix42
GPG key ID: 24363525EA0E8A99

View file

@ -376,21 +376,40 @@
]; ];
# periodic automated mail fetching # periodic automated mail fetching
systemd.user.services.mailfetch = { systemd.user.services.mbsync = {
enable = true; description = "Automated mail fetch and tagging";
description = "Automatically fetches new mails.";
wantedBy = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = { serviceConfig = {
Restart = "always"; Type = "oneshot";
RestartSec = "60";
}; };
path = with pkgs; [ bash notmuch isync ]; path = with pkgs; [ bash isync notmuch ];
script = '' script = "mbsync -a";
mbsync -a && /home/felix/.config/neomutt/notmuch-hook.sh postStop = "/home/felix/.config/neomutt/notmuch-hook.sh";
'';
}; };
systemd.user.timers.mbsync = {
description = "Automated mail fetch and processing";
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "10m";
OnUnitInactiveSec = "10m";
};
};
# systemd.user.services.mailfetch = {
# enable = true;
# description = "Automatically fetches new mails.";
# wantedBy = [ "graphical-session.target" ];
# after = [ "graphical-session.target" ];
# serviceConfig = {
# Restart = "always";
# RestartSec = "60";
# };
# path = with pkgs; [ bash notmuch isync ];
# script = ''
# mbsync -a && /home/felix/.config/neomutt/notmuch-hook.sh
# '';
# };
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions # settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave # on your system were taken. Its perfectly fine and recommended to leave