diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 01:35:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 02:11:48 +0200 |
commit | 1a64deeb894dc95e2645a75771732c6cc53a79ad (patch) | |
tree | 1b9df4838f894577a09b9b260151756272efeb53 /modules/private/mail/default.nix | |
parent | fa25ffd4583cc362075cd5e1b4130f33306103f0 (diff) | |
download | Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip |
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them
contained personnal information about users. All thos changes got
stashed into a single commit (history is kept in a different place) and
private information was moved in a separate private repository
Diffstat (limited to 'modules/private/mail/default.nix')
-rw-r--r-- | modules/private/mail/default.nix | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/modules/private/mail/default.nix b/modules/private/mail/default.nix deleted file mode 100644 index 2d405c6..0000000 --- a/modules/private/mail/default.nix +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | { lib, pkgs, config, ... }: | ||
2 | { | ||
3 | imports = [ | ||
4 | ./milters.nix | ||
5 | ./postfix.nix | ||
6 | ./dovecot.nix | ||
7 | ./relay.nix | ||
8 | ./rspamd.nix | ||
9 | ./opensmtpd.nix | ||
10 | ./sympa.nix | ||
11 | ]; | ||
12 | options.myServices.mail.enable = lib.mkEnableOption "enable Mail services"; | ||
13 | options.myServices.mailRelay.enable = lib.mkEnableOption "enable Mail relay services"; | ||
14 | options.myServices.mailBackup.enable = lib.mkEnableOption "enable MX backup services"; | ||
15 | |||
16 | config = lib.mkIf config.myServices.mail.enable { | ||
17 | security.acme.certs."mail" = config.myServices.certificates.certConfig // { | ||
18 | domain = config.hostEnv.fqdn; | ||
19 | extraDomains = let | ||
20 | zonesWithMx = builtins.filter (zone: | ||
21 | lib.attrsets.hasAttr "withEmail" zone && lib.lists.length zone.withEmail > 0 | ||
22 | ) config.myEnv.dns.masterZones; | ||
23 | mxs = map (zone: "${config.hostEnv.mx.subdomain}.${zone.name}") zonesWithMx; | ||
24 | in builtins.listToAttrs (map (mx: lib.attrsets.nameValuePair mx null) mxs); | ||
25 | }; | ||
26 | # This is for clients that don’t support elliptic curves (e.g. | ||
27 | # printer) | ||
28 | security.acme.certs."mail-rsa" = config.myServices.certificates.certConfig // { | ||
29 | domain = config.hostEnv.fqdn; | ||
30 | keyType = "rsa4096"; | ||
31 | extraDomains = let | ||
32 | zonesWithMx = builtins.filter (zone: | ||
33 | lib.attrsets.hasAttr "withEmail" zone && lib.lists.length zone.withEmail > 0 | ||
34 | ) config.myEnv.dns.masterZones; | ||
35 | mxs = map (zone: "${config.hostEnv.mx.subdomain}.${zone.name}") zonesWithMx; | ||
36 | in builtins.listToAttrs (map (mx: lib.attrsets.nameValuePair mx null) mxs); | ||
37 | }; | ||
38 | systemd.slices.mail = { | ||
39 | description = "Mail slice"; | ||
40 | }; | ||
41 | }; | ||
42 | } | ||