nix-config/home/mail/himalaya/default.nix
Bruno BELANYI 9f7472222c treewide: use 'lib.getExe' when possible
Don't use it in wireguard to keep it consistent, as only half the
commands could use it.
2023-08-06 20:13:08 +02:00

24 lines
503 B
Nix

{ 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 = lib.getExe pkgs.libnotify;
in
pkgs.writeScript "mail-notifier" ''
SENDER="$1"
SUBJECT="$2"
${notify-send} \
-c himalaya \
-- "$(printf 'Received email from %s\n\n%s' "$SENDER" "$SUBJECT")"
'';
};
};
}