1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-26 19:59:47 +01:00
home-manager/tests/modules/programs/mbsync/mbsync.nix
Karl H f63c15c137
isync/mbsync: update module for 1.5.0 changes (#5918)
* mbsync: Add NEWS entry about isync 1.5.0 changes

* mbsync: Place config file in $XDG_CONFIG_HOME

mbsync 1.5.0 supports placing isync's configuration file in
$XDG_CONFIG_HOME/isyncrc [1].

[1] https://sourceforge.net/projects/isync/files/isync/1.5.0/

* mbsync: Replace SSLType with TLSType

mbsync 1.5.0 replaced the name of the configuration option [1].

Also update SSLVersions to TLSVersions for the same reason. Inform the
user if the option was renamed.

[1] https://sourceforge.net/projects/isync/files/isync/1.5.0/

* mbsync: Replace SSLVersions with TLSVerisons

* mbsync: Update extraConfig.account example with SSL->TLS changes
2024-12-09 15:32:05 +01:00

86 lines
2.3 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
{
imports = [ ../../accounts/email-test-accounts.nix ];
config = {
programs.mbsync = {
enable = true;
# programs.mbsync.groups and
# accounts.email.accounts.<name>.mbsync.groups should NOT be used at the
# same time.
# If they are, then the new version will take precedence.
groups.inboxes = {
"hm@example.com" = [ "Inbox1" "Inbox2" ];
hm-account = [ "Inbox" ];
};
};
accounts.email.accounts = {
"hm@example.com".mbsync = {
enable = true;
extraConfig.account.TLSVersions = [ "+1.3" "+1.2" "-1.1" ];
groups.inboxes = {
channels = {
inbox1 = {
farPattern = "Inbox1";
nearPattern = "Inboxes";
};
inbox2 = {
farPattern = "Inbox2";
nearPattern = "Inboxes";
};
};
};
};
hm-account.mbsync = {
enable = true;
groups.hm-account = {
channels.earlierPatternMatch = {
farPattern = "Label";
nearPattern = "SomethingUnderLabel";
patterns = [
"ThingUnderLabel"
"!NotThisMaildirThough"
''"[Weird] Label?"''
];
};
channels.inbox = {
farPattern = "Inbox";
nearPattern = "Inbox";
};
channels.strangeHostBoxName = {
farPattern = "[Weird]/Label Mess";
nearPattern = "[AnotherWeird]/Label";
};
channels.patternMatch = {
farPattern = "Label";
nearPattern = "SomethingUnderLabel";
patterns = [
"ThingUnderLabel"
"!NotThisMaildirThough"
''"[Weird] Label?"''
];
};
};
# No group should be printed.
groups.emptyGroup = { };
# Group should be printed, but left with default channels.
groups.emptyChannels = {
channels.empty1 = { };
channels.empty2 = { };
};
};
};
test.stubs.isync = { };
nmt.script = ''
assertFileExists home-files/.config/isyncrc
assertFileContent home-files/.config/isyncrc ${./mbsync-expected.conf}
'';
};
}