mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +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
|
@ -146,8 +146,8 @@ import nmt {
|
||||||
./modules/xresources
|
./modules/xresources
|
||||||
] ++ lib.optionals isDarwin [
|
] ++ lib.optionals isDarwin [
|
||||||
./modules/launchd
|
./modules/launchd
|
||||||
|
./modules/services/imapnotify-darwin
|
||||||
./modules/targets-darwin
|
./modules/targets-darwin
|
||||||
./modules/programs/goimapnotify
|
|
||||||
] ++ lib.optionals isLinux [
|
] ++ lib.optionals isLinux [
|
||||||
./modules/config/i18n
|
./modules/config/i18n
|
||||||
./modules/i18n/input-method
|
./modules/i18n/input-method
|
||||||
|
@ -205,6 +205,7 @@ import nmt {
|
||||||
./modules/services/gpg-agent
|
./modules/services/gpg-agent
|
||||||
./modules/services/gromit-mpx
|
./modules/services/gromit-mpx
|
||||||
./modules/services/home-manager-auto-upgrade
|
./modules/services/home-manager-auto-upgrade
|
||||||
|
./modules/services/imapnotify
|
||||||
./modules/services/kanshi
|
./modules/services/kanshi
|
||||||
./modules/services/lieer
|
./modules/services/lieer
|
||||||
./modules/services/mopidy
|
./modules/services/mopidy
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
{ goimapnotify-launchd = ./launchd.nix; }
|
|
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; }
|
1
tests/modules/services/imapnotify/default.nix
Normal file
1
tests/modules/services/imapnotify/default.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{ imapnotify = ./imapnotify.nix; }
|
39
tests/modules/services/imapnotify/imapnotify.nix
Normal file
39
tests/modules/services/imapnotify/imapnotify.nix
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
{ 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}
|
||||||
|
'';
|
||||||
|
}
|
12
tests/modules/services/imapnotify/imapnotify.service
Normal file
12
tests/modules/services/imapnotify/imapnotify.service
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Environment=NOTMUCH_CONFIG=/home/hm-user/.config/notmuch/default/config
|
||||||
|
ExecStart=@goimapnotify@/bin/goimapnotify -conf '/nix/store/00000000000000000000000000000000-imapnotify-hm-example.com-config.json'
|
||||||
|
Restart=always
|
||||||
|
RestartSec=30
|
||||||
|
Type=simple
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=imapnotify for hm-example.com
|
Loading…
Reference in a new issue