mirror of
https://github.com/nix-community/home-manager
synced 2024-06-29 01:48:31 +02: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
|
@ -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 {
|
create = mkOption {
|
||||||
type = types.enum [ "none" "maildir" "imap" "both" ];
|
type = types.enum [ "none" "maildir" "imap" "both" ];
|
||||||
default = "none";
|
default = "none";
|
||||||
|
|
|
@ -65,10 +65,13 @@ let
|
||||||
+ genSection "IMAPStore ${name}-remote"
|
+ genSection "IMAPStore ${name}-remote"
|
||||||
({ Account = name; } // mbsync.extraConfig.remote) + "\n"
|
({ Account = name; } // mbsync.extraConfig.remote) + "\n"
|
||||||
+ genSection "MaildirStore ${name}-local" ({
|
+ genSection "MaildirStore ${name}-local" ({
|
||||||
Path = "${maildir.absPath}/";
|
|
||||||
Inbox = "${maildir.absPath}/${folders.inbox}";
|
Inbox = "${maildir.absPath}/${folders.inbox}";
|
||||||
SubFolders = "Verbatim";
|
} // optionalAttrs
|
||||||
} // optionalAttrs (mbsync.flatten != null) { Flatten = mbsync.flatten; }
|
(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;
|
// mbsync.extraConfig.local) + "\n" + genChannels account;
|
||||||
|
|
||||||
genChannels = account:
|
genChannels = account:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user