Commit d0520489b106
Changed files (1)
home
common
desktop
home/common/desktop/mails.nix
@@ -96,6 +96,22 @@
programs.mbsync.enable = true;
programs.msmtp.enable = true;
+
+ # Run mbsync periodically to push local changes (sent mail, moved messages)
+ # This complements goimapnotify which only triggers on incoming mail
+ services.mbsync = {
+ enable = true;
+ frequency = "*:0/15"; # Every 15 minutes
+ postExec = ''
+ # Update mu index after sync
+ # Use emacsclient if mu4e is running to avoid lock conflicts
+ if ${pkgs.procps}/bin/pgrep -u $UID mu >/dev/null 2>&1; then
+ ${pkgs.emacs}/bin/emacsclient --eval '(mu4e-update-index)' 2>/dev/null || true
+ else
+ ${pkgs.mu}/bin/mu index --quiet
+ fi
+ '';
+ };
programs.mu = {
enable = true;
# Use XDG_DATA_HOME instead of XDG_CACHE_HOME to persist the mu database