spice up cli life some more:
- mx for fzf manix - orage maybe useful as a calendar?? - email notifications - all user services allowed to send notifications
This commit is contained in:
@@ -1,35 +1,4 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
safeName = lib.replaceStrings [ "@" ":" "\\" "[" "]" ] [ "-" "-" "-" "" "" ];
|
||||
imapnotifyAccounts =
|
||||
filter (a: a.imapnotify.enable) (attrValues config.accounts.email.accounts);
|
||||
genAccountUnit = account:
|
||||
let name = safeName account.name;
|
||||
in
|
||||
{
|
||||
name = "imapnotify-${name}-mine";
|
||||
value = {
|
||||
Unit = { Description = "imapnotify for ${name}"; };
|
||||
|
||||
Service = {
|
||||
ExecStart = "${pkgs.goimapnotify}/bin/goimapnotify -conf /nix/store/6030i9xdga98l2zyqarrqv5mrjynwm3i-imapnotify-anish-config.json"; # TODO horrible hard coded config location
|
||||
Restart = "always";
|
||||
RestartSec = 30;
|
||||
Type = "simple";
|
||||
# this is why we're overriding this stupid thing
|
||||
# We need dbus for notify-send on systemd
|
||||
Environment = [
|
||||
"DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus"
|
||||
"NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/default/config"
|
||||
];
|
||||
};
|
||||
|
||||
Install = { WantedBy = [ "default.target" ]; };
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
#age.secrets.fastmail.file = "/etc/nixos/secrets/fastmail.age";
|
||||
#age.secrets.fastmail.owner = "anish";
|
||||
@@ -41,12 +10,9 @@ in
|
||||
services.mbsync = {
|
||||
enable = true;
|
||||
frequency = "*:0/30";
|
||||
#postExec = "${pkgs.notmuch}/bin/notmuch new";
|
||||
postExec = "${pkgs.notmuch}/bin/notmuch new";
|
||||
};
|
||||
|
||||
# call our stupid way of overriding the imapnotify service
|
||||
systemd.user.services = listToAttrs (map genAccountUnit [{ name = "anish"; }]);
|
||||
|
||||
services.imapnotify.enable = true;
|
||||
programs.mbsync.enable = true;
|
||||
programs.msmtp.enable = true;
|
||||
@@ -304,10 +270,10 @@ in
|
||||
extraConfig.local.subFolders = "Verbatim";
|
||||
};
|
||||
imapnotify = {
|
||||
enable = false;
|
||||
enable = true;
|
||||
boxes = [ "Inbox" ];
|
||||
onNotify = "${pkgs.isync}/bin/mbsync anish && ${pkgs.notmuch}/bin/notmuch index";
|
||||
onNotifyPost = "${pkgs.libnotify}/bin/notify-send -a mail 'email: new in %s'";
|
||||
onNotify = "${pkgs.isync}/bin/mbsync anish && ${pkgs.notmuch}/bin/notmuch new";
|
||||
onNotifyPost = "${pkgs.libnotify}/bin/notify-send 'New Email 📩'";
|
||||
};
|
||||
msmtp.enable = true;
|
||||
msmtp.extraConfig = {
|
||||
|
||||
Reference in New Issue
Block a user