From 2bd357f1aec7c6502ab47d5c04ed9505ac681edd Mon Sep 17 00:00:00 2001 From: joy Date: Thu, 22 Aug 2024 14:14:25 +0200 Subject: [PATCH] email sync services --- home/default.nix | 3 +-- home/neomutt/default.nix | 15 -------------- modules/mail/default.nix | 40 ++++++++++++++++++++---------------- modules/packages/default.nix | 12 +++++++++++ 4 files changed, 35 insertions(+), 35 deletions(-) delete mode 100644 home/neomutt/default.nix diff --git a/home/default.nix b/home/default.nix index dc964cf..fe02c09 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,4 +1,4 @@ -{inputs, ...}: { +{...}: { imports = [ ./zsh ./gtk @@ -11,7 +11,6 @@ ./alacritty ./hyprland ./hypridle - ./neomutt ./newsboat ./dunst ]; diff --git a/home/neomutt/default.nix b/home/neomutt/default.nix deleted file mode 100644 index a900668..0000000 --- a/home/neomutt/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{pkgs, ...}: { - home.packages = with pkgs; [ - mutt-wizard - neomutt - msmtp - curl - isync - pass - lynx - notmuch - abook - mpop - urlscan - ]; -} diff --git a/modules/mail/default.nix b/modules/mail/default.nix index cd8586b..3755895 100644 --- a/modules/mail/default.nix +++ b/modules/mail/default.nix @@ -1,21 +1,25 @@ -{...}:{ -systemd.services.email-sync = { - description = "Service to sync emails"; - serviceConfig = { - ExecStart = "mw -Y"; - User = "joy"; - Group = "users"; - }; - wantedBy = [ "multi-user.target" ]; -}; +{...}: -systemd.timers.email-sync = { - description = "Timer to run email sync every 10 minutes"; - timerConfig = { - OnBootSec = "1min"; - OnUnitActiveSec = "10min"; +{ + systemd.services.mw-service = { + after = [ "network.target" ]; + serviceConfig = { + User = "joy"; + ExecStart = "/run/current-system/sw/bin/mw -Y"; + Environment = "PATH=/run/current-system/sw/bin:/usr/bin:/bin"; # Ensure all required paths are included + }; + wantedBy = [ "multi-user.target" ]; + }; + systemd.timers.mw-service-timer = { + timerConfig = { + OnBootSec = "5sec"; + OnUnitActiveSec = "10sec"; + AccuracySec = "1sec"; + }; + unitConfig = { + Wants = [ "mw-service.service" ]; + After = [ "mw-service.service" ]; + }; }; - wants = [ "email-sync.service" ]; - unit = "email-sync.service"; -}; } + diff --git a/modules/packages/default.nix b/modules/packages/default.nix index 898c724..a60fbd0 100644 --- a/modules/packages/default.nix +++ b/modules/packages/default.nix @@ -49,6 +49,18 @@ networkmanagerapplet ncdu git + #mutt + mutt-wizard + neomutt + msmtp + curl + isync + pass + lynx + notmuch + abook + mpop + urlscan #office sent ];