diff --git a/pkgs/check-mail.nix b/pkgs/check-mail.nix deleted file mode 100644 index 7a5390e..0000000 --- a/pkgs/check-mail.nix +++ /dev/null @@ -1,14 +0,0 @@ -self: -with self; '' - ${offlineimap}/bin/offlineimap - - for dir in ~/Mail/* - do - unread=$(find "''${dir}/INBOX/" -type f | grep -vE ',[^,]*S[^,]*$') - - if [ ! -z "''${unread}" ]; then - inbox=$(basename $dir) - ${libnotify}/bin/notify-send "''${inbox} has unread mail" - fi - done -'' diff --git a/pkgs/default.nix b/pkgs/default.nix index 6c5eef6..4ef1df7 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -13,7 +13,6 @@ with prev; { mu = writeShellScriptBin "mu" (import ./mu.nix final); p = writeShellScriptBin "p" (import ./p.nix final); present-md = writeShellScriptBin "present-md" (import ./present-md.nix final); - check-mail = writeShellScriptBin "check-mail" (import ./check-mail.nix final); s = writeShellScriptBin "s" (import ./s.nix final); sway-launcher = writeScriptBin "sway-launcher" (import ./sway-launcher.nix final); sway-service = writeShellScriptBin "sway-service" (import ./sway-service.nix final); diff --git a/users/b12f/email.nix b/users/b12f/email.nix index 2b96db4..ca3d00f 100644 --- a/users/b12f/email.nix +++ b/users/b12f/email.nix @@ -39,9 +39,11 @@ with lib; let tls.useStartTls = true; }; + offlineimap.enable = true; imapnotify = { enable = true; boxes = [ "INBOX" ]; + onNotify = "${pkgs.offlineimap}/bin/offlineimap -a ${address}"; onNotifyPost = "${pkgs.libnotify}/bin/notify-send '${address} has new mail'"; }; msmtp.enable = true; @@ -58,13 +60,11 @@ with lib; let +Trash ''; }; - offlineimap.enable = true; } // (if args ? "config" then args.config else {}); in { users.users."${psCfg.user.name}".packages = with pkgs; [ w3m mailto-mutt - check-mail ]; home-manager.users."${psCfg.user.name}" = rec { @@ -119,6 +119,7 @@ in { ]; }; + services.imapnotify.enable = true; programs.offlineimap.enable = true; programs.msmtp.enable = true; programs.neomutt = {