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
1
tests/modules/services/imapnotify-darwin/default.nix
Normal file
1
tests/modules/services/imapnotify-darwin/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
{ imapnotify-launchd = ./launchd.nix; }
|
||||
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}
|
||||
'';
|
||||
}
|
||||
29
tests/modules/services/imapnotify-darwin/launchd.plist
Normal file
29
tests/modules/services/imapnotify-darwin/launchd.plist
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>EnvironmentVariables</key>
|
||||
<dict>
|
||||
<key>NOTMUCH_CONFIG</key>
|
||||
<string>/home/hm-user/.config/notmuch/default/config</string>
|
||||
</dict>
|
||||
<key>ExitTimeOut</key>
|
||||
<integer>0</integer>
|
||||
<key>KeepAlive</key>
|
||||
<true/>
|
||||
<key>Label</key>
|
||||
<string>org.nix-community.home.imapnotify-hm-example.com</string>
|
||||
<key>ProcessType</key>
|
||||
<string>Background</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>@goimapnotify@/bin/goimapnotify</string>
|
||||
<string>-conf</string>
|
||||
<string>/nix/store/00000000000000000000000000000000-imapnotify-hm-example.com-config.json</string>
|
||||
</array>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
<key>ThrottleInterval</key>
|
||||
<integer>30</integer>
|
||||
</dict>
|
||||
</plist>
|
||||
Loading…
Add table
Add a link
Reference in a new issue