home: mail: add himalaya
This mail client is very KISS. I like it.
This commit is contained in:
parent
791109c3c1
commit
ff8e64d601
|
@ -15,6 +15,10 @@ let
|
||||||
|
|
||||||
inherit primary;
|
inherit primary;
|
||||||
|
|
||||||
|
himalaya = {
|
||||||
|
enable = cfg.himalaya.enable;
|
||||||
|
};
|
||||||
|
|
||||||
msmtp = {
|
msmtp = {
|
||||||
enable = cfg.msmtp.enable;
|
enable = cfg.msmtp.enable;
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,12 +7,17 @@ in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./accounts.nix
|
./accounts.nix
|
||||||
|
./himalaya.nix
|
||||||
./msmtp.nix
|
./msmtp.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.my.home.mail = with lib; {
|
options.my.home.mail = with lib; {
|
||||||
enable = my.mkDisableOption "email configuration";
|
enable = my.mkDisableOption "email configuration";
|
||||||
|
|
||||||
|
himalaya = {
|
||||||
|
enable = mkRelatedOption "himalaya configuration";
|
||||||
|
};
|
||||||
|
|
||||||
msmtp = {
|
msmtp = {
|
||||||
enable = mkRelatedOption "msmtp configuration";
|
enable = mkRelatedOption "msmtp configuration";
|
||||||
};
|
};
|
||||||
|
|
23
home/mail/himalaya.nix
Normal file
23
home/mail/himalaya.nix
Normal 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")"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue