nixpkgs/pkgs/servers/monitoring/prometheus/php-fpm-exporter.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

60 lines
1.4 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, makeWrapper
, installShellFiles
, getent
, nix-update-script
, testers
, prometheus-php-fpm-exporter
}:
buildGoModule rec {
pname = "php-fpm_exporter";
version = "2.2.0";
src = fetchFromGitHub {
owner = "hipages";
repo = pname;
rev = "v${version}";
hash = "sha256-ggrFnyEdGBoZVh4dHMw+7RUm8nJ1hJXo/fownO3wvzE=";
};
vendorHash = "sha256-OK36tHkBtosdfEWFPYMtlbzCkh5cF35NBWYyJrb9fwg=";
nativeBuildInputs = [ makeWrapper installShellFiles ];
ldflags = [
"-X main.version=${version}"
];
preFixup = ''
wrapProgram "$out/bin/php-fpm_exporter" \
--prefix PATH ":" "${lib.makeBinPath [ getent ]}"
'';
postInstall = ''
installShellCompletion --cmd php-fpm_exporter \
--bash <($out/bin/php-fpm_exporter completion bash) \
--fish <($out/bin/php-fpm_exporter completion fish) \
--zsh <($out/bin/php-fpm_exporter completion zsh)
'';
passthru = {
updateScript = nix-update-script { };
tests = testers.testVersion {
inherit version;
package = prometheus-php-fpm-exporter;
command = "php-fpm_exporter version";
};
};
meta = with lib; {
homepage = "https://github.com/hipages/php-fpm_exporter";
description = "Prometheus exporter for PHP-FPM";
license = licenses.asl20;
maintainers = with maintainers; [ gaelreyrol ];
mainProgram = "php-fpm_exporter";
};
}