mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
imapnotify: only write onNew* if a value is available
This commit is contained in:
parent
d244ca125f
commit
0d110a0936
1 changed files with 6 additions and 4 deletions
|
@ -44,17 +44,19 @@ let
|
||||||
143;
|
143;
|
||||||
|
|
||||||
toJSON = builtins.toJSON;
|
toJSON = builtins.toJSON;
|
||||||
in toJSON {
|
in toJSON ({
|
||||||
inherit (account.imap) host;
|
inherit (account.imap) host;
|
||||||
inherit port;
|
inherit port;
|
||||||
tls = account.imap.tls.enable;
|
tls = account.imap.tls.enable;
|
||||||
username = account.userName;
|
username = account.userName;
|
||||||
passwordCmd =
|
passwordCmd =
|
||||||
lib.concatMapStringsSep " " lib.escapeShellArg account.passwordCommand;
|
lib.concatMapStringsSep " " lib.escapeShellArg account.passwordCommand;
|
||||||
onNewMail = account.imapnotify.onNotify;
|
|
||||||
onNewMailPost = account.imapnotify.onNotifyPost;
|
|
||||||
inherit (account.imapnotify) boxes;
|
inherit (account.imapnotify) boxes;
|
||||||
});
|
} // optionalAttrs (account.imapnotify.onNotify != "") {
|
||||||
|
onNewMail = account.imapnotify.onNotify;
|
||||||
|
} // optionalAttrs (account.imapnotify.onNotifyPost != "") {
|
||||||
|
onNewMailPost = account.imapnotify.onNotifyPost;
|
||||||
|
}));
|
||||||
|
|
||||||
in {
|
in {
|
||||||
meta.maintainers = [ maintainers.nickhu ];
|
meta.maintainers = [ maintainers.nickhu ];
|
||||||
|
|
Loading…
Reference in a new issue