home: mail: add himalaya

This mail client is very KISS. I like it.
This commit is contained in:
Bruno BELANYI 2021-06-22 17:59:47 +02:00
parent 791109c3c1
commit ff8e64d601
3 changed files with 32 additions and 0 deletions

23
home/mail/himalaya.nix Normal file
View file

@ -0,0 +1,23 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.mail.himalaya;
in
{
config.programs.himalaya = lib.mkIf cfg.enable {
enable = true;
settings = {
notify-cmd =
let
notify-send = "${pkgs.libnotify}/bin/notify-send";
in
pkgs.writeScript "mail-notifier" ''
SENDER="$1"
SUBJECT="$2"
${notify-send} \
-c himalaya \
-- "$(printf 'Received email from %s\n\n%s' "$SENDER" "$SUBJECT")"
'';
};
};
}