about summary refs log tree commit diff
path: root/ops/modules/depot-inbox.nix
blob: b791cc6db7303d8fc6cce7abb63195db9e485d74 (plain) (blame)
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
# public-inbox configuration for depot@tvl.su
#
# The account itself is a Yandex 360 account in the tvl.su organisation, which
# is accessed via IMAP. Yandex takes care of spam filtering for us, so there is
# no particular SpamAssassin or other configuration.
{ config, lib, pkgs, ... }:

let
  cfg = config.services.depot.inbox;
in
{
  options.services.depot.inbox = with lib; {
    enable = mkEnableOption "Enable public-inbox for depot@tvl.su";

    depotPath = mkOption {
      description = "path to local depot replica";
      type = types.str;
      default = "/var/lib/depot";
    };
  };

  config = lib.mkIf cfg.enable {
    services.public-inbox = {
      enable = true;

      http.enable = true;
      http.port = 8053;
      # imap.enable = true;
      # nntp.enable = true;

      inboxes.depot = rec {
        address = [
          "depot@tvl.su" # primary address
          "depot@tazj.in" # legacy address
        ];

        description = "TVL depot development";
        coderepo = [ "depot" ];
        url = "https://inbox.tvl.su/depot";
      };

      settings.coderepo.depot = {
        dir = cfg.depotPath;
        cgitUrl = "https://code.tvl.fyi";
      };

      settings.publicinbox.wwwlisting = "all";
    };
  };
}