prometheus-alertmanager: Add versionCheckHook (#461323)

This commit is contained in:
Aleksana
2025-11-22 11:59:05 +00:00
committed by GitHub
2 changed files with 13 additions and 8 deletions
@@ -5,17 +5,17 @@
fetchFromGitHub,
installShellFiles,
nixosTests,
versionCheckHook,
}:
buildGoModule rec {
buildGoModule (finalAttrs: {
pname = "alertmanager";
version = "0.29.0";
rev = "v${version}";
src = fetchFromGitHub {
inherit rev;
owner = "prometheus";
repo = "alertmanager";
tag = "v${finalAttrs.version}";
hash = "sha256-2uP4JCbQEe7/en5sBq/k73kqK6YVmuLvfiUy1fqPitw=";
};
@@ -31,8 +31,8 @@ buildGoModule rec {
t = "github.com/prometheus/common/version";
in
[
"-X ${t}.Version=${version}"
"-X ${t}.Revision=${src.rev}"
"-X ${t}.Version=${finalAttrs.version}"
"-X ${t}.Revision=unknown"
"-X ${t}.Branch=unknown"
"-X ${t}.BuildUser=nix@nixpkgs"
"-X ${t}.BuildDate=unknown"
@@ -50,11 +50,17 @@ buildGoModule rec {
passthru.tests = { inherit (nixosTests.prometheus) alertmanager; };
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
meta = with lib; {
description = "Alert dispatcher for the Prometheus monitoring system";
homepage = "https://github.com/prometheus/alertmanager";
changelog = "https://github.com/prometheus/alertmanager/blob/v${version}/CHANGELOG.md";
changelog = "https://github.com/prometheus/alertmanager/blob/v${finalAttrs.version}/CHANGELOG.md";
license = licenses.asl20;
mainProgram = "alertmanager";
maintainers = with maintainers; [
benley
fpletz
@@ -62,4 +68,4 @@ buildGoModule rec {
Frostman
];
};
}
})
-1
View File
@@ -9530,7 +9530,6 @@ with pkgs;
postgrest = haskellPackages.postgrest.bin;
prom2json = callPackage ../servers/monitoring/prometheus/prom2json.nix { };
prometheus-alertmanager = callPackage ../servers/monitoring/prometheus/alertmanager.nix { };
prometheus-apcupsd-exporter = callPackage ../servers/monitoring/prometheus/apcupsd-exporter.nix { };
prometheus-artifactory-exporter =
callPackage ../servers/monitoring/prometheus/artifactory-exporter.nix