diff --git a/home/accounts/fastmail.nix b/home/accounts/fastmail.nix index c6dd56a9..42aef59c 100644 --- a/home/accounts/fastmail.nix +++ b/home/accounts/fastmail.nix @@ -31,9 +31,6 @@ port = 465; tls.enable = true; }; - imapnotify = { - enable = true; - }; passwordCommand = ["cat" "${config.sops.secrets."accounts/mail/fastmail".path}"]; mbsync = { enable = true; diff --git a/home/programs/neomutt.nix b/home/programs/neomutt.nix index 49b5823d..e17455e7 100644 --- a/home/programs/neomutt.nix +++ b/home/programs/neomutt.nix @@ -1,4 +1,9 @@ -{pkgs, ...}: { +{pkgs, ...}: let + theme = builtins.fetchurl { + url = "https://raw.githubusercontent.com/catppuccin/neomutt/refs/heads/main/neomuttrc"; + sha256 = "sha256:1q086p5maqwxa4gh6z8g7h3nfavdmkbql025ibdhglpz46hsq0hs"; + }; +in { programs.neomutt = { enable = true; vimKeys = true; @@ -6,6 +11,9 @@ sidebar = { enable = true; }; + extraConfig = '' + source ${theme} + ''; }; programs.notmuch = { enable = true; @@ -17,4 +25,16 @@ enable = true; neomutt.enable = true; }; + services.imapnotify = { + enable = true; + path = [pkgs.coreutils pkgs.isync pkgs.libnotify]; + }; + accounts.email.accounts.fastmail.imapnotify = { + enable = true; + boxes = ["Inbox"]; + onNotify = "${pkgs.writeShellScript "mbsync-notify" '' + ${pkgs.isync}/bin/mbsync $1 + ${pkgs.libnotify}/bin/notify-send "New Mail" "New email in $1" + ''} %s"; + }; }