mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-02 23:21:02 +01:00
imapnotify: move test
Also add test for the systemd service.
This commit is contained in:
parent
fad475553a
commit
b70db52ff0
8 changed files with 55 additions and 2 deletions
41
tests/modules/services/imapnotify-darwin/launchd.nix
Normal file
41
tests/modules/services/imapnotify-darwin/launchd.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{ 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 = let
|
||||
serviceFileName = "org.nix-community.home.imapnotify-hm-example.com.plist";
|
||||
in ''
|
||||
serviceFile="LaunchAgents/${serviceFileName}"
|
||||
serviceFileNormalized="$(normalizeStorePaths "$serviceFile")"
|
||||
assertFileExists $serviceFile
|
||||
assertFileContent $serviceFileNormalized ${./launchd.plist}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue