summaryrefslogtreecommitdiff
path: root/home/mail/default.nix
blob: 38bc41ed4daaf35f34f7b7360f2fca0272ddad15 (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
44
45
46
47
48
49
50
51
{ config, lib, ... }:
with lib; {
  config = mkIf (!config.home.isolation.active) {
    accounts.email = {
      maildirBasePath = "mail";

      accounts.local = {
        address = "alejandro@34project.org";
        userName = "alejandro@34project.org";
        realName = "Alejandro Soto";

        primary = true;

        # ${maildirBasePath}/${maildir.path}
        maildir.path = "";
        folders.inbox = "";

        msmtp.enable = true;
        neomutt.enable = true;

        smtp = {
          host = "smtp.34project.org";

          tls = {
            enable = true;
            useStartTls = true;
          };
        };
      };
    };

    programs = {
      msmtp.enable = true;

      neomutt = {
        enable = true;
        vimKeys = true;

        settings = {
          record = "+.Sent";
          postponed = "+.Drafts";

          use_threads = "flat";
          index_format = "'%4C %Z %<[y?%<[m?%<[d?%[%H:%M ]&%[%a %d]>&%[%b %d]>&%[%m/%y ]> %-15.15L (%?l?%4l&%4c?) %s'";
        };
      };
    };

    home.file.".dovecot.sieve".source = ./dovecot.sieve;
  };
}