summaryrefslogtreecommitdiff
path: root/nix/modules/home/msmtp.nix
blob: c1abd8f40d4a1b0c39ec1bb444b16940f3e92c88 (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
{ lib, config, super, ... }:
{
  programs.msmtp = {
    enable = lib.mkDefault config.monorepo.profiles.email.enable;
    extraConfig = ''
      # Set default values for all following accounts.
      defaults
      auth           on
      tls            on
      tls_trust_file /etc/ssl/certs/ca-certificates.crt
      tls_certcheck  off
      logfile        ~/.msmtp.log

      # Gmail
      account        ${super.monorepo.vars.internetName}
      host           mail.${super.monorepo.vars.orgHost}
      port           587
      from           ${super.monorepo.vars.email}
      user           ${super.monorepo.vars.email}
      passwordeval   "cat ${config.sops.secrets.mail.path}"


      # Set a default account
      account default : ${super.monorepo.vars.internetName}
    '';
  };
}