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