mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
mbsync: add subFolders option (#1760)
The `SubFolders` option in mbsync controls the folder naming style in the maildir. There are three different styles: * Verbatim - <maildirPath>/top/sub/subsub * Maildir++ - <inboxPath>/.top.sub.subsub (used by Dovecot) * Legacy - <maildirPath>/top/.sub/.subsub Previously, the `SubFolders` option was hardcoded to `Verbatim`. This change allows configuration of the `SubFolders` option.
This commit is contained in:
parent
fc87ac92af
commit
6dfa9ef85c
2 changed files with 16 additions and 3 deletions
|
@ -125,6 +125,16 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
subFolders = mkOption {
|
||||
type = types.enum [ "Verbatim" "Maildir++" "Legacy" ];
|
||||
default = "Verbatim";
|
||||
example = "Maildir++";
|
||||
description = ''
|
||||
The on-disk folder naming style. This option has no
|
||||
effect when <option>flatten</option> is used.
|
||||
'';
|
||||
};
|
||||
|
||||
create = mkOption {
|
||||
type = types.enum [ "none" "maildir" "imap" "both" ];
|
||||
default = "none";
|
||||
|
|
|
@ -65,10 +65,13 @@ let
|
|||
+ genSection "IMAPStore ${name}-remote"
|
||||
({ Account = name; } // mbsync.extraConfig.remote) + "\n"
|
||||
+ genSection "MaildirStore ${name}-local" ({
|
||||
Path = "${maildir.absPath}/";
|
||||
Inbox = "${maildir.absPath}/${folders.inbox}";
|
||||
SubFolders = "Verbatim";
|
||||
} // optionalAttrs (mbsync.flatten != null) { Flatten = mbsync.flatten; }
|
||||
} // optionalAttrs
|
||||
(mbsync.subFolders != "Maildir++" || mbsync.flatten != null) {
|
||||
Path = "${maildir.absPath}/";
|
||||
} // optionalAttrs (mbsync.flatten == null) {
|
||||
SubFolders = mbsync.subFolders;
|
||||
} // optionalAttrs (mbsync.flatten != null) { Flatten = mbsync.flatten; }
|
||||
// mbsync.extraConfig.local) + "\n" + genChannels account;
|
||||
|
||||
genChannels = account:
|
||||
|
|
Loading…
Reference in a new issue