2023-07-07 11:39:12 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
imports = [ ../../accounts/email-test-accounts.nix ];
|
|
|
|
|
2023-07-08 09:57:38 +02:00
|
|
|
accounts.email.accounts = {
|
|
|
|
"hm@example.com" = {
|
|
|
|
notmuch.enable = true;
|
|
|
|
imap.port = 993;
|
2023-07-07 11:39:12 +02:00
|
|
|
|
2023-07-08 09:57:38 +02:00
|
|
|
imapnotify = {
|
|
|
|
enable = true;
|
|
|
|
boxes = [ "Inbox" ];
|
|
|
|
onNotify = ''
|
|
|
|
${pkgs.notmuch}/bin/notmuch new
|
|
|
|
'';
|
2023-07-07 11:39:12 +02:00
|
|
|
};
|
|
|
|
};
|
2023-07-08 09:57:38 +02:00
|
|
|
};
|
2023-07-07 11:39:12 +02:00
|
|
|
|
2023-07-08 09:57:38 +02:00
|
|
|
services.imapnotify = {
|
|
|
|
enable = true;
|
|
|
|
package = (config.lib.test.mkStubPackage {
|
|
|
|
name = "goimapnotify";
|
|
|
|
outPath = "@goimapnotify@";
|
|
|
|
});
|
2023-07-07 11:39:12 +02:00
|
|
|
};
|
2023-07-08 09:57:38 +02:00
|
|
|
|
|
|
|
test.stubs.notmuch = { };
|
|
|
|
|
|
|
|
nmt.script = let
|
|
|
|
serviceFileName = "org.nix-community.home.imapnotify-hm-example.com.plist";
|
|
|
|
in ''
|
|
|
|
serviceFile=LaunchAgents/${serviceFileName}
|
|
|
|
assertFileExists $serviceFile
|
|
|
|
assertFileContent $serviceFile ${./launchd.plist}
|
|
|
|
'';
|
2023-07-07 11:39:12 +02:00
|
|
|
}
|