summaryrefslogtreecommitdiff
path: root/modules/nixos/nullmailer.nix
blob: 193b1097fcd56ee4a1e663994e196eac99c11867 (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
{
  config,
  inputs,
  lib,
  ...
}:
with lib; let
  cfg = config.nixfiles.modules.nullmailer;
in {
  options.nixfiles.modules.nullmailer.enable = mkEnableOption "Nullmailer";

  config = mkIf cfg.enable {
    # No use in enabling it other than having a retry queue.
    # ark.directories = ["/var/spool/nullmailer"];

    secrets.nullmailer-remotes = with config.services.nullmailer; {
      file = "${inputs.self}/secrets/nullmailer-remotes";
      owner = user;
      inherit group;
    };

    services.nullmailer = {
      enable = true;
      remotesFile = config.secrets.nullmailer-remotes.path;
      config.me = config.networking.domain;
    };
  };
}