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