aboutsummaryrefslogtreecommitdiffstats
path: root/modules/private/email.example.nix
blob: ae3b47594f3d235633700e0713a5eac0f9bf5e2a (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
38
39
40
41
42
43
{ config, ... }:

let
  mailDir = "${config.home.homeDirectory}/.local/mail";
in
{
  accounts.email.accounts = {
    "example" = {
      realName = "Example User";
      address = "user@example.com";
      userName = "user@example.com";
      passwordCommand = "${config.programs.gopass.package}/bin/gopass show -o mail/example";
      flavor = "gmail.com";

      mbsync = {
        enable = true;
        createMailbox = true;
        extraConfig.channel = {
          Patterns = "*";
          SyncState = "*";
        };
      };

      notmuch.enable = true;

      mu.enable = false;
      msmtp.enable = false;
      imapnotify.enable = false;
    };
  };

  # Mbsync config
  programs.mbsync = {
    enable = true;
    directory = mailDir;
  };

  # Notmuch config
  programs.notmuch = {
    enable = true;
    database.path = "${mailDir}/.notmuch";
  };
}