2018-08-16 19:37:42 +00:00
|
|
|
{ lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2018-09-02 05:58:54 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
extraConfigType = with lib.types; attrsOf (either (either str int) bool);
|
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
in {
|
2018-08-16 19:37:42 +00:00
|
|
|
options.mbsync = {
|
|
|
|
enable = mkEnableOption "synchronization using mbsync";
|
|
|
|
|
|
|
|
flatten = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = null;
|
|
|
|
example = ".";
|
|
|
|
description = ''
|
|
|
|
If set, flattens the hierarchy within the maildir by
|
|
|
|
substituting the canonical hierarchy delimiter
|
|
|
|
<literal>/</literal> with this value.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
create = mkOption {
|
|
|
|
type = types.enum [ "none" "maildir" "imap" "both" ];
|
|
|
|
default = "none";
|
|
|
|
example = "maildir";
|
|
|
|
description = ''
|
|
|
|
Automatically create missing mailboxes within the
|
|
|
|
given mail store.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
remove = mkOption {
|
|
|
|
type = types.enum [ "none" "maildir" "imap" "both" ];
|
|
|
|
default = "none";
|
|
|
|
example = "imap";
|
|
|
|
description = ''
|
|
|
|
Propagate mailbox deletions to the given mail store.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
expunge = mkOption {
|
|
|
|
type = types.enum [ "none" "maildir" "imap" "both" ];
|
|
|
|
default = "none";
|
|
|
|
example = "both";
|
|
|
|
description = ''
|
|
|
|
Permanently remove messages marked for deletion from
|
|
|
|
the given mail store.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
patterns = mkOption {
|
|
|
|
type = types.listOf types.str;
|
|
|
|
default = [ "*" ];
|
|
|
|
description = ''
|
|
|
|
Pattern of mailboxes to synchronize.
|
|
|
|
'';
|
|
|
|
};
|
2018-09-02 05:58:54 +00:00
|
|
|
|
|
|
|
extraConfig.channel = mkOption {
|
|
|
|
type = extraConfigType;
|
2020-02-01 23:39:17 +00:00
|
|
|
default = { };
|
2018-09-02 05:58:54 +00:00
|
|
|
example = literalExample ''
|
|
|
|
{
|
|
|
|
MaxMessages = 10000;
|
|
|
|
MaxSize = "1m";
|
|
|
|
};
|
|
|
|
'';
|
|
|
|
description = ''
|
|
|
|
Per channel extra configuration.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
extraConfig.local = mkOption {
|
|
|
|
type = extraConfigType;
|
2020-02-01 23:39:17 +00:00
|
|
|
default = { };
|
2018-09-02 05:58:54 +00:00
|
|
|
description = ''
|
|
|
|
Local store extra configuration.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
extraConfig.remote = mkOption {
|
|
|
|
type = extraConfigType;
|
2020-02-01 23:39:17 +00:00
|
|
|
default = { };
|
2018-09-02 05:58:54 +00:00
|
|
|
description = ''
|
|
|
|
Remote store extra configuration.
|
|
|
|
'';
|
|
|
|
};
|
2018-10-03 18:35:04 +00:00
|
|
|
|
|
|
|
extraConfig.account = mkOption {
|
|
|
|
type = extraConfigType;
|
2020-02-01 23:39:17 +00:00
|
|
|
default = { };
|
2018-10-03 18:35:04 +00:00
|
|
|
example = literalExample ''
|
|
|
|
{
|
|
|
|
PipelineDepth = 10;
|
|
|
|
Timeout = 60;
|
|
|
|
};
|
|
|
|
'';
|
|
|
|
description = ''
|
|
|
|
Account section extra configuration.
|
|
|
|
'';
|
|
|
|
};
|
2018-08-16 19:37:42 +00:00
|
|
|
};
|
|
|
|
}
|