aboutsummaryrefslogtreecommitdiffstats
path: root/modules/private/email.example.nix
blob: d816b323e5588406a93d99d73a6189b4d27d2639 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ config, lib, ... }:

{
  config.accounts.email.accounts = {
    "example" = {
      realName = "example";
      address = "user@gmail.com";
      userName = "user@gmail.com";
      passwordCommand = "${lib.getExe config.programs.gopass.package} -o mail/user@gmail.com";
      flavor = "gmail.com";
      primary = true;
      neomutt.enable = true;

      neomutt.extraConfig = ''
        mailboxes "+Inbox" "+[Gmail]/Drafts" "+[Gmail]/Spam" "+[Gmail]/Trash"
      '';

      mbsync = {
        enable = true;
        create = "maildir";
        patterns = [
          "Inbox"
          "\"[Gmail]/Drafts\""
          "\"[Gmail]/Spam\""
          "\"[Gmail]/Trash\""
        ];
        extraConfig.channel = {
          SyncState = "*";
          Sync = "All";
          CopyArrivalDate = "yes";
        };
      };

      notmuch.enable = true;
    };
  };
}