2021-06-22 17:59:47 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.my.home.mail.himalaya;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
config.programs.himalaya = lib.mkIf cfg.enable {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
notify-cmd =
|
|
|
|
let
|
2023-07-23 19:58:40 +02:00
|
|
|
notify-send = lib.getExe pkgs.libnotify;
|
2021-06-22 17:59:47 +02:00
|
|
|
in
|
|
|
|
pkgs.writeScript "mail-notifier" ''
|
|
|
|
SENDER="$1"
|
|
|
|
SUBJECT="$2"
|
|
|
|
${notify-send} \
|
|
|
|
-c himalaya \
|
|
|
|
-- "$(printf 'Received email from %s\n\n%s' "$SENDER" "$SUBJECT")"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|