Merge pull request #112351 from logan12358/prometheus-nginx-exporter-service
nixos/prometheus-nginx-exporter: only create service if nginx exporter is enabled
This commit is contained in:
commit
bfa15ad956
@ -238,9 +238,6 @@ in
|
||||
services.prometheus.exporters.minio.minioAccessSecret = mkDefault config.services.minio.secretKey;
|
||||
})] ++ [(mkIf config.services.prometheus.exporters.rtl_433.enable {
|
||||
hardware.rtl-sdr.enable = mkDefault true;
|
||||
})] ++ [(mkIf config.services.nginx.enable {
|
||||
systemd.services.prometheus-nginx-exporter.after = [ "nginx.service" ];
|
||||
systemd.services.prometheus-nginx-exporter.requires = [ "nginx.service" ];
|
||||
})] ++ [(mkIf config.services.postfix.enable {
|
||||
services.prometheus.exporters.postfix.group = mkDefault config.services.postfix.setgidGroup;
|
||||
})] ++ (mapAttrsToList (name: conf:
|
||||
|
@ -42,7 +42,7 @@ in
|
||||
'';
|
||||
};
|
||||
};
|
||||
serviceOpts = {
|
||||
serviceOpts = mkMerge ([{
|
||||
serviceConfig = {
|
||||
ExecStart = ''
|
||||
${pkgs.prometheus-nginx-exporter}/bin/nginx-prometheus-exporter \
|
||||
@ -54,7 +54,10 @@ in
|
||||
${concatStringsSep " \\\n " cfg.extraFlags}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}] ++ [(mkIf config.services.nginx.enable {
|
||||
after = [ "nginx.service" ];
|
||||
requires = [ "nginx.service" ];
|
||||
})]);
|
||||
imports = [
|
||||
(mkRenamedOptionModule [ "telemetryEndpoint" ] [ "telemetryPath" ])
|
||||
(mkRemovedOptionModule [ "insecure" ] ''
|
||||
|
Loading…
Reference in New Issue
Block a user