mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 06:45:16 +01:00
755b915a15
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/'
59 lines
1.4 KiB
Nix
59 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";
|
|
};
|
|
}
|