1 { pkgs, lib, config, ... }:
2 let inherit (config.services) public-inbox;
3 inherit (config.users) groups;
4 domain = "sourcephile.fr";
6 # Pour supprimer un message :
7 # curl https://mails.sourcephile.fr/inbox/environnement/8ea699887ca47797b4460053588cbef2d115829ab4@vieber.ru/raw |
8 # sudo -u public-inbox public-inbox-learn rm
10 security.acme.certs."${domain}" = {
11 postRun = "systemctl try-restart public-inbox-nntpd public-inbox-imapd";
13 networking.nftables.ruleset = ''
14 add rule inet filter net2fw tcp dport ${toString public-inbox.nntp.port} counter accept comment "NNTPS"
15 add rule inet filter net2fw tcp dport 1993 counter accept comment "IMAPS"
18 public-inbox-httpd = {
20 SupplementaryGroups = [ groups."git-daemon".name ];
21 BindReadOnlyPaths = [ "/var/lib/acme/${domain}" ];
24 public-inbox-imapd = {
25 wants = [ "acme-selfsigned-${domain}.service" "acme-${domain}.service"];
26 after = [ "acme-selfsigned-${domain}.service" ];
28 SupplementaryGroups = [ groups."acme".name ];
29 BindReadOnlyPaths = [ "/var/lib/acme/${domain}" ];
30 RestrictAddressFamilies = [ "AF_INET" ]; # For custom --listen
33 public-inbox-nntpd = {
34 wants = [ "acme-selfsigned-${domain}.service" "acme-${domain}.service"];
35 after = [ "acme-selfsigned-${domain}.service" ];
37 SupplementaryGroups = [ groups."acme".name ];
38 BindReadOnlyPaths = [ "/var/lib/acme/${domain}" ];
42 services.public-inbox = {
44 settings.publicinbox = {
45 css = [ "href=https://mails.${domain}/style/light.css" ];
46 nntpserver = [ "nntps://news.${domain}" ];
47 wwwlisting = "match=domain";
51 args = [ "--no-precheck" ]; # Allow Bcc:
55 port = "/run/publix-inbox-http.sock";
58 "https://mails.${domain}/inbox"
59 "https://public-inbox.${domain}/inbox"
65 cert = "/var/lib/acme/${domain}/fullchain.pem";
66 key = "/var/lib/acme/${domain}/key.pem";
69 args = [ "--listen" "imaps://0.0.0.0:1993/?cert=/var/lib/acme/${domain}/fullchain.pem,key=/var/lib/acme/${domain}/key.pem" ];
71 # FIXME: find an IP or .onion to put 993
73 #cert = "/var/lib/acme/${domain}/fullchain.pem";
74 #key = "/var/lib/acme/${domain}/key.pem";
80 "public-inbox+atelier@${domain}"
82 url = "https://mails.${domain}/inbox/atelier";
85 discussions concernant le développement logiciel.
87 newsgroup = "inbox.comp.sourcephile.atelier";
90 # TODO: list many source code repositories
97 "public-inbox+bar@${domain}"
101 discussions concernant l'informatique en général.
103 url = "https://mails.${domain}/inbox/bar";
104 newsgroup = "inbox.comp.sourcephile.bar";
109 "public-inbox+contact@${domain}"
113 discussions avec le grand public.
115 url = "https://mails.${domain}/inbox/contact";
116 newsgroup = "inbox.comp.sourcephile.contact";
117 #coderepo = [ "sourcephile" ];
122 "public-inbox+ecole@${domain}"
126 discussions pour s'entraider en informatique.
128 url = "https://mails.${domain}/inbox/ecole";
129 newsgroup = "inbox.comp.sourcephile.ecole";
130 coderepo = [ "sourcephile-txt" ];
134 "environnement@${domain}"
135 "public-inbox+environnement@${domain}"
138 environnement@${domain} :
139 discussions sur les impacts environnementaux de l'informatique.
141 url = "https://mails.${domain}/inbox/environnement";
142 newsgroup = "inbox.comp.sourcephile.environnement";
143 coderepo = [ "sourcephile-txt" ];
148 "public-inbox+labo@${domain}"
152 discussions concernant la science de l'informatique.
154 url = "https://mails.${domain}/inbox/labo";
155 newsgroup = "inbox.comp.sourcephile.labo";
158 # TODO: list many source code repositories
164 "public-inbox+machines@${domain}"
168 discussions concernant l'administration technique de l'infrastructure informatique.
170 url = "https://mails.${domain}/inbox/machines";
171 newsgroup = "inbox.comp.sourcephile.machines";
172 coderepo = [ "sourcephile-txt" "sourcephile-nix" ];
177 "public-inbox+pont@${domain}"
181 discussions à l'attention de l'ensemble des personnes à bord.
183 url = "https://mails.${domain}/inbox/pont";
184 newsgroup = "inbox.comp.sourcephile.pont";
185 coderepo = [ "sourcephile-txt" ];
190 "public-inbox+test@${domain}"
194 une cible de test pour effectuer des tirs de mails.
196 url = "https://mails.${domain}/inbox/test";
197 newsgroup = "inbox.comp.sourcephile.test";
198 hide = [ "www" "manifest" ];
201 settings.coderepo = {
203 dir = "/var/lib/gitolite/repositories/sourcephile-txt.git";
204 cgitUrl = "https://code.${domain}/sourcephile-txt.git";
207 dir = "/var/lib/gitolite/repositories/sourcephile-nix.git";
208 cgitUrl = "https://code.${domain}/sourcephile-nix.git";