From ddd47e1e1c217ba6b1b2638ee618d8a62d08662e Mon Sep 17 00:00:00 2001 From: Karl Hallsby Date: Sat, 27 Jun 2020 02:25:06 +0200 Subject: [PATCH] mbsync: switch channel/group generation to new functions Changing this out is what moves us from the old system to the new one. Instead of having a single channel manage a whole mailbox, we can now specify an attribute set of groups that should correspond to an email account. Each of these groups contains an attribute set of channels that make it up, and are grouped together for synchronization. In addition, each of these channels can have additional IMAP4 parameters attached to them to further refine synchronization. Lastly, each of the channels is grouped together under the Group section, ensuring that the channels' mailboxes synchronize as they have been specified. --- modules/programs/mbsync.nix | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/modules/programs/mbsync.nix b/modules/programs/mbsync.nix index a44d009c..ba51d90b 100644 --- a/modules/programs/mbsync.nix +++ b/modules/programs/mbsync.nix @@ -69,16 +69,10 @@ let Inbox = "${maildir.absPath}/${folders.inbox}"; SubFolders = "Verbatim"; } // optionalAttrs (mbsync.flatten != null) { Flatten = mbsync.flatten; } - // mbsync.extraConfig.local) + "\n" + genSection "Channel ${name}" ({ - Master = ":${name}-remote:"; - Slave = ":${name}-local:"; - Patterns = mbsync.patterns; - Create = masterSlaveMapping.${mbsync.create}; - Remove = masterSlaveMapping.${mbsync.remove}; - Expunge = masterSlaveMapping.${mbsync.expunge}; - SyncState = "*"; - } // mbsync.extraConfig.channel) + "\n"; - # Given the attr set of groups, return a string of channels to put into each group. + // mbsync.extraConfig.local) + "\n" + + genGroupChannelConfig name mbsync.groups + + genAccountGroups mbsync.groups; + # Given the attr set of groups, return a string of channels that will direct # mail to the proper directories, according to the pattern used in channel's # master pattern definition.