summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2022-06-16 23:36:28 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2022-06-20 19:30:59 +0200
commit5ab65d9cd117e68d2cf96972182893d60fca5c18 (patch)
tree590dba7d0019a02b1124a779126755820e149895
parentcb94b381158843946df733aec15d2ec843a3113c (diff)
downloadnixpkgs-5ab65d9cd117e68d2cf96972182893d60fca5c18.tar
nixpkgs-5ab65d9cd117e68d2cf96972182893d60fca5c18.tar.gz
nixpkgs-5ab65d9cd117e68d2cf96972182893d60fca5c18.tar.bz2
nixpkgs-5ab65d9cd117e68d2cf96972182893d60fca5c18.tar.lz
nixpkgs-5ab65d9cd117e68d2cf96972182893d60fca5c18.tar.xz
nixpkgs-5ab65d9cd117e68d2cf96972182893d60fca5c18.tar.zst
nixpkgs-5ab65d9cd117e68d2cf96972182893d60fca5c18.zip
nixos/prometheus-postfix-exporter: fixes for systemd integration
* Allow the service to read from the journal w/systemd.enable
* Ensure that the service is started after postfix.service
-rw-r--r--nixos/modules/services/monitoring/prometheus/exporters/postfix.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/exporters/postfix.nix b/nixos/modules/services/monitoring/prometheus/exporters/postfix.nix
index 4d3c1fa267e..53509b7a385 100644
--- a/nixos/modules/services/monitoring/prometheus/exporters/postfix.nix
+++ b/nixos/modules/services/monitoring/prometheus/exporters/postfix.nix
@@ -74,11 +74,13 @@ in
     };
   };
   serviceOpts = {
+    after = mkIf cfg.systemd.enable [ cfg.systemd.unit ];
     serviceConfig = {
       DynamicUser = false;
       # By default, each prometheus exporter only gets AF_INET & AF_INET6,
       # but AF_UNIX is needed to read from the `showq`-socket.
       RestrictAddressFamilies = [ "AF_UNIX" ];
+      SupplementaryGroups = mkIf cfg.systemd.enable [ "systemd-journal" ];
       ExecStart = ''
         ${pkgs.prometheus-postfix-exporter}/bin/postfix_exporter \
           --web.listen-address ${cfg.listenAddress}:${toString cfg.port} \