From 8bee65350bee04fa2a1d285c95e381052d24c8cc Mon Sep 17 00:00:00 2001 From: Karl Hallsby Date: Fri, 26 Jun 2020 13:41:25 +0200 Subject: [PATCH] mbsync: option for configuring a group A group is a grouping of channels together, so that many channels with very different names can be handled as a single entity. Groups are unique in mbsync because they will shadow channels that have the same name on the command-line. --- modules/programs/mbsync-accounts.nix | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/modules/programs/mbsync-accounts.nix b/modules/programs/mbsync-accounts.nix index 19f926c8..23442b35 100644 --- a/modules/programs/mbsync-accounts.nix +++ b/modules/programs/mbsync-accounts.nix @@ -1,4 +1,4 @@ -{ lib, ... }: +{ config, lib, ... }: with lib; @@ -6,6 +6,32 @@ let extraConfigType = with lib.types; attrsOf (either (either str int) bool); + perAccountGroups = { name, config, ... }: { + options = { + groupName = mkOption { + type = types.str; + default = name; + description = '' + The name of this group for this account. These names are different than + some others, because they will hide channel names that are the same. + ''; + }; + + channels = mkOption { + type = types.listOf (types.submodule groupChannel); + default = { }; + description = '' + List of channels that should be grouped together into this group. When + performing a synchronization, the groups are synchronized, rather than + the individual channels. + + Using these channels and then grouping them together allows for you to + define the maildir hierarchy as you see fit. + ''; + }; + }; + }; + # Options for configuring channel(s) that will be composed together into a group. groupChannel = { config, ... }: { options = {