diff options
Diffstat (limited to 'flakes/private/openarc/flake.nix')
-rw-r--r-- | flakes/private/openarc/flake.nix | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/flakes/private/openarc/flake.nix b/flakes/private/openarc/flake.nix index 9cc9aed..5c4b73c 100644 --- a/flakes/private/openarc/flake.nix +++ b/flakes/private/openarc/flake.nix | |||
@@ -17,12 +17,17 @@ | |||
17 | outputs = { self, nix-lib, my-lib, files-watcher, openarc }: | 17 | outputs = { self, nix-lib, my-lib, files-watcher, openarc }: |
18 | let | 18 | let |
19 | cfg = name': { config, lib, pkgs, name, ... }: { | 19 | cfg = name': { config, lib, pkgs, name, ... }: { |
20 | imports = [ (my-lib.lib.withNarKey files-watcher "nixosModule") ]; | 20 | imports = [ |
21 | (my-lib.lib.withNarKey files-watcher "nixosModule") | ||
22 | (my-lib.lib.withNarKey openarc "nixosModule") | ||
23 | #FIXME: | ||
24 | #(my-lib.lib.withNarKey secrets "nixosModule") | ||
25 | ]; | ||
21 | config = lib.mkIf (name == name') { | 26 | config = lib.mkIf (name == name') { |
22 | services.openarc = { | 27 | services.openarc = { |
23 | enable = true; | 28 | enable = true; |
24 | user = "opendkim"; | 29 | user = "opendkim"; |
25 | socket = "local:${config.myServices.mail.milters.sockets.openarc}"; | 30 | socket = "/run/openarc/openarc.sock"; |
26 | group = config.services.postfix.group; | 31 | group = config.services.postfix.group; |
27 | configFile = pkgs.writeText "openarc.conf" '' | 32 | configFile = pkgs.writeText "openarc.conf" '' |
28 | AuthservID mail.immae.eu | 33 | AuthservID mail.immae.eu |
@@ -35,12 +40,11 @@ | |||
35 | ''; | 40 | ''; |
36 | }; | 41 | }; |
37 | systemd.services.openarc.serviceConfig.Slice = "mail.slice"; | 42 | systemd.services.openarc.serviceConfig.Slice = "mail.slice"; |
38 | systemd.services.openarc.postStart = lib.optionalString | 43 | systemd.services.openarc.postStart = '' |
39 | (lib.strings.hasPrefix "local:" config.services.openarc.socket) '' | 44 | while [ ! -S ${config.services.openarc.socket} ]; do |
40 | while [ ! -S ${lib.strings.removePrefix "local:" config.services.openarc.socket} ]; do | ||
41 | sleep 0.5 | 45 | sleep 0.5 |
42 | done | 46 | done |
43 | chmod g+w ${lib.strings.removePrefix "local:" config.services.openarc.socket} | 47 | chmod g+w ${config.services.openarc.socket} |
44 | ''; | 48 | ''; |
45 | services.filesWatcher.openarc = { | 49 | services.filesWatcher.openarc = { |
46 | restart = true; | 50 | restart = true; |