2018-08-06 12:04:56 +02:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
extraConfigType = with types; attrsOf (either (either str int) bool);
|
|
|
|
|
2020-02-02 00:39:17 +01:00
|
|
|
in {
|
2018-08-06 12:04:56 +02:00
|
|
|
options.offlineimap = {
|
2023-07-01 01:30:13 +02:00
|
|
|
enable = mkEnableOption (lib.mdDoc "OfflineIMAP");
|
2018-08-06 12:04:56 +02:00
|
|
|
|
2018-11-19 23:04:34 +01:00
|
|
|
extraConfig.account = mkOption {
|
|
|
|
type = extraConfigType;
|
2020-02-02 00:39:17 +01:00
|
|
|
default = { };
|
|
|
|
example = { autorefresh = 20; };
|
2023-07-01 01:30:13 +02:00
|
|
|
description = lib.mdDoc ''
|
2018-11-19 23:04:34 +01:00
|
|
|
Extra configuration options to add to the account section.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2018-08-06 12:04:56 +02:00
|
|
|
extraConfig.local = mkOption {
|
|
|
|
type = extraConfigType;
|
2020-02-02 00:39:17 +01:00
|
|
|
default = { };
|
|
|
|
example = { sync_deletes = true; };
|
2023-07-01 01:30:13 +02:00
|
|
|
description = lib.mdDoc ''
|
2018-08-06 12:04:56 +02:00
|
|
|
Extra configuration options to add to the local account
|
|
|
|
section.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
extraConfig.remote = mkOption {
|
|
|
|
type = extraConfigType;
|
2020-02-02 00:39:17 +01:00
|
|
|
default = { };
|
2018-08-06 12:04:56 +02:00
|
|
|
example = {
|
|
|
|
maxconnections = 2;
|
|
|
|
expunge = false;
|
|
|
|
};
|
2023-07-01 01:30:13 +02:00
|
|
|
description = lib.mdDoc ''
|
2018-08-06 12:04:56 +02:00
|
|
|
Extra configuration options to add to the remote account
|
|
|
|
section.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
postSyncHookCommand = mkOption {
|
|
|
|
type = types.lines;
|
|
|
|
default = "";
|
2023-07-01 01:30:13 +02:00
|
|
|
description = lib.mdDoc "Command to run after fetching new mails.";
|
2018-08-06 12:04:56 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|