diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2021-01-02 02:32:37 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2021-01-02 02:32:37 +0100 |
commit | 238587099b92027ad780053f0f6217ad88b61ad2 (patch) | |
tree | 3d3fa506cef6845fdb09fc651a6aaac342ed2520 /flakes/private | |
parent | a1a2455f53bde1235b221a842d3c888c51fcecac (diff) | |
download | Nix-238587099b92027ad780053f0f6217ad88b61ad2.tar.gz Nix-238587099b92027ad780053f0f6217ad88b61ad2.tar.zst Nix-238587099b92027ad780053f0f6217ad88b61ad2.zip |
Move flake private file in common place
Diffstat (limited to 'flakes/private')
-rw-r--r-- | flakes/private/openarc.nix | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/flakes/private/openarc.nix b/flakes/private/openarc.nix new file mode 100644 index 0000000..5244ca9 --- /dev/null +++ b/flakes/private/openarc.nix | |||
@@ -0,0 +1,35 @@ | |||
1 | pkgs: | ||
2 | let | ||
3 | cfg = name': { config, lib, pkgs, name, ... }: lib.mkIf (name == name') { | ||
4 | services.openarc = { | ||
5 | enable = true; | ||
6 | user = "opendkim"; | ||
7 | socket = "local:${config.myServices.mail.milters.sockets.openarc}"; | ||
8 | group = config.services.postfix.group; | ||
9 | configFile = pkgs.writeText "openarc.conf" '' | ||
10 | AuthservID mail.immae.eu | ||
11 | Domain mail.immae.eu | ||
12 | KeyFile ${config.secrets.fullPaths."opendkim/eldiron.private"} | ||
13 | Mode sv | ||
14 | Selector eldiron | ||
15 | SoftwareHeader yes | ||
16 | Syslog Yes | ||
17 | ''; | ||
18 | }; | ||
19 | systemd.services.openarc.serviceConfig.Slice = "mail.slice"; | ||
20 | systemd.services.openarc.postStart = lib.optionalString | ||
21 | (lib.strings.hasPrefix "local:" config.services.openarc.socket) '' | ||
22 | while [ ! -S ${lib.strings.removePrefix "local:" config.services.openarc.socket} ]; do | ||
23 | sleep 0.5 | ||
24 | done | ||
25 | chmod g+w ${lib.strings.removePrefix "local:" config.services.openarc.socket} | ||
26 | ''; | ||
27 | services.filesWatcher.openarc = { | ||
28 | restart = true; | ||
29 | paths = [ | ||
30 | config.secrets.fullPaths."opendkim/eldiron.private" | ||
31 | ]; | ||
32 | }; | ||
33 | }; | ||
34 | in | ||
35 | pkgs.lib.genAttrs ["eldiron" "backup-2"] cfg | ||