diff options
| author | Periklis Tsirakidis <periklis.tsirakidis@holidaycheck.com> | 2018-06-04 13:04:16 +0200 |
|---|---|---|
| committer | Periklis Tsirakidis <periklis.tsirakidis@holidaycheck.com> | 2018-06-04 16:25:07 +0200 |
| commit | b85d89a1aee4db1417be1b9aaeb19df736a1364e (patch) | |
| tree | 71fa654a712eee3a1790589283418da209241b78 /tests | |
| parent | 07175b169bf4cab57bb8edffd3df96537dffeb57 (diff) | |
Init offlineimap service
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/services-offlineimap.nix | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/services-offlineimap.nix b/tests/services-offlineimap.nix new file mode 100644 index 0000000..dfbbb57 --- /dev/null +++ b/tests/services-offlineimap.nix @@ -0,0 +1,43 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + offlineimap = pkgs.runCommand "offlineimap-0.0.0" {} "mkdir -p $out"; +in + +{ + services.offlineimap.enable = true; + services.offlineimap.package = offlineimap; + services.offlineimap.runQuick = true; + services.offlineimap.extraConfig = '' + [general] + accounts = test + ui = quiet + + [Account test] + localrepository = testLocal + remoterepository = testRemote + autorefresh = 2 + maxage = 2017-07-01 + + [Repository testLocal] + type = GmailMaildir + + [Repository testRemote] + type = Gmail + ssl = yes + starttls = no + expunge = yes + ''; + + test = '' + echo >&2 "checking offlineimap service in ~/Library/LaunchAgents" + grep "org.nixos.offlineimap" ${config.out}/user/Library/LaunchAgents/org.nixos.offlineimap.plist + grep "exec\ offlineimap" ${config.out}/user/Library/LaunchAgents/org.nixos.offlineimap.plist + grep "\-q" ${config.out}/user/Library/LaunchAgents/org.nixos.offlineimap.plist + + echo >&2 "checking config in /etc/offlineimaprc" + grep "accounts\ \=\ test" ${config.out}/etc/offlineimaprc + ''; +} |
