blob: 6a2518b9e9c2ec6c52fc6c022fc1712870305408 (
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
|
{
inputs.openarc = {
url = "https://git.immae.eu/perso/Immae/Config/Nix.git";
type = "git";
dir = "flakes/openarc";
};
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
description = "Private configuration for openarc";
outputs = { self, nixpkgs, openarc }:
let
cfg = name': { config, lib, pkgs, name, ... }: lib.mkIf (name == name') {
services.openarc = {
enable = true;
user = "opendkim";
socket = "local:${config.myServices.mail.milters.sockets.openarc}";
group = config.services.postfix.group;
configFile = pkgs.writeText "openarc.conf" ''
AuthservID mail.immae.eu
Domain mail.immae.eu
KeyFile ${config.secrets.fullPaths."opendkim/eldiron.private"}
Mode sv
Selector eldiron
SoftwareHeader yes
Syslog Yes
'';
};
systemd.services.openarc.serviceConfig.Slice = "mail.slice";
systemd.services.openarc.postStart = lib.optionalString
(lib.strings.hasPrefix "local:" config.services.openarc.socket) ''
while [ ! -S ${lib.strings.removePrefix "local:" config.services.openarc.socket} ]; do
sleep 0.5
done
chmod g+w ${lib.strings.removePrefix "local:" config.services.openarc.socket}
'';
services.filesWatcher.openarc = {
restart = true;
paths = [
config.secrets.fullPaths."opendkim/eldiron.private"
];
};
};
in
openarc.outputs //
{ nixosModules = openarc.nixosModules or {} // nixpkgs.lib.genAttrs ["eldiron" "backup-2"] cfg; };
}
|