diff --git a/modules/common/mail/default.nix b/modules/common/mail/default.nix index 56c667b..27e3a16 100644 --- a/modules/common/mail/default.nix +++ b/modules/common/mail/default.nix @@ -27,10 +27,8 @@ home-manager.users.${config.user} = { programs.mbsync = { enable = true; }; - services.mbsync = lib.mkIf pkgs.stdenv.isLinux { - enable = true; - frequency = "*:0/5"; - }; + services.imapnotify.enable = pkgs.stdenv.isLinux && config.physical; + programs.notmuch.enable = true; accounts.email = { maildirBasePath = "${config.homePath}/mail"; accounts = { @@ -55,10 +53,11 @@ tls.enable = true; }; imapnotify = { - enable = false; - boxes = [ ]; - onNotify = ""; - onNotifyPost = ""; + enable = true; + boxes = [ "Inbox" ]; + onNotify = "${pkgs.isync}/bin/mbsync -a"; + onNotifyPost = + "${pkgs.libnotify}/bin/notify-send 'New mail arrived'"; }; maildir = { path = "main"; }; mbsync = { @@ -72,7 +71,7 @@ }; }; mu.enable = false; - notmuch.enable = false; + notmuch.enable = true; passwordCommand = "${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${ builtins.toString ../../../private/mailpass.age diff --git a/modules/nixos/graphical/polybar.nix b/modules/nixos/graphical/polybar.nix index 155f07e..61f1f0f 100644 --- a/modules/nixos/graphical/polybar.nix +++ b/modules/nixos/graphical/polybar.nix @@ -36,7 +36,7 @@ module-margin = 1; modules-left = "i3"; modules-center = "xwindow"; - modules-right = "pulseaudio date power"; + modules-right = "mailcount pulseaudio date power"; cursor-click = "pointer"; cursor-scroll = "ns-resize"; enable-ipc = true; @@ -101,6 +101,22 @@ # label-unmounted = "%mountpoint% not mounted"; # label-unmounted-foreground = colors.disabled; # }; + "module/mailcount" = { + type = "custom/script"; + interval = 10; + format = "