mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 19:49:45 +01:00
fb0196ad9d
* imapnotify: enable STARTTLS if enabled in email account config Since version 2.3.10 goimapnotify supports starttls. In version 2.3.11 a typo in the settings was fixed, using tlsOptions.starttls to enable it. This commit enables starttls in the goimapnotify config file if it is enabled in the email account's imap settings. * imapnotify: test generated config file Compare the generated service config file with a manually verified sample.
44 lines
1.1 KiB
Nix
44 lines
1.1 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
imports = [ ../../accounts/email-test-accounts.nix ];
|
|
|
|
accounts.email.accounts = {
|
|
"hm@example.com" = {
|
|
notmuch.enable = true;
|
|
imap.port = 993;
|
|
|
|
imapnotify = {
|
|
enable = true;
|
|
boxes = [ "Inbox" ];
|
|
onNotify = ''
|
|
${pkgs.notmuch}/bin/notmuch new
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
services.imapnotify = {
|
|
enable = true;
|
|
package = (config.lib.test.mkStubPackage {
|
|
name = "goimapnotify";
|
|
outPath = "@goimapnotify@";
|
|
});
|
|
};
|
|
|
|
test.stubs.notmuch = { };
|
|
|
|
nmt.script = ''
|
|
serviceFile="home-files/.config/systemd/user/imapnotify-hm-example.com.service"
|
|
serviceFileNormalized="$(normalizeStorePaths "$serviceFile")"
|
|
assertFileExists $serviceFile
|
|
assertFileContent $serviceFileNormalized ${./imapnotify.service}
|
|
|
|
configFile="home-files/.config/imapnotify/imapnotify-hm-example.com-config.json"
|
|
configFileNormalized="$(normalizeStorePaths "$configFile")"
|
|
assertFileExists $configFile
|
|
assertFileContent $configFileNormalized ${./imapnotify-config.json}
|
|
'';
|
|
}
|