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 = { };
|
|
|
|
|
2023-07-09 07:34:18 +00:00
|
|
|
nmt.script = ''
|
|
|
|
serviceFile="home-files/.config/systemd/user/imapnotify-hm-example.com.service"
|
2023-07-07 22:08:00 +00:00
|
|
|
serviceFileNormalized="$(normalizeStorePaths "$serviceFile")"
|
2023-07-08 07:57:38 +00:00
|
|
|
assertFileExists $serviceFile
|
2023-07-09 07:34:18 +00:00
|
|
|
assertFileContent $serviceFileNormalized ${./imapnotify.service}
|
2023-07-08 07:57:38 +00:00
|
|
|
'';
|
2023-07-07 09:39:12 +00:00
|
|
|
}
|