2022-12-28 21:21:41 +00:00
|
|
|
{ lib
|
|
|
|
, go
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "alertmanager";
|
2022-12-28 21:21:41 +00:00
|
|
|
version = "0.25.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit rev;
|
|
|
|
owner = "prometheus";
|
|
|
|
repo = "alertmanager";
|
2022-12-28 21:21:41 +00:00
|
|
|
hash = "sha256-h87m3flE2GRAXMBgaAC+sOsPWEs7l9loQt6jGaSdXfQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
vendorHash = "sha256-BX4mT0waYtKvNyOW3xw5FmXI8TLmv857YBFTnV7XXD8=";
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
subPackages = [ "cmd/alertmanager" "cmd/amtool" ];
|
|
|
|
|
|
|
|
ldflags = let t = "github.com/prometheus/common/version"; in [
|
2021-08-27 14:25:00 +00:00
|
|
|
"-X ${t}.Version=${version}"
|
|
|
|
"-X ${t}.Revision=${src.rev}"
|
|
|
|
"-X ${t}.Branch=unknown"
|
|
|
|
"-X ${t}.BuildUser=nix@nixpkgs"
|
|
|
|
"-X ${t}.BuildDate=unknown"
|
|
|
|
"-X ${t}.GoVersion=${lib.getVersion go}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
2020-05-15 21:57:56 +00:00
|
|
|
$out/bin/amtool --completion-script-bash > amtool.bash
|
2020-05-03 17:38:23 +00:00
|
|
|
installShellCompletion amtool.bash
|
2022-02-10 20:34:41 +00:00
|
|
|
$out/bin/amtool --completion-script-zsh > amtool.zsh
|
|
|
|
installShellCompletion amtool.zsh
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Alert dispatcher for the Prometheus monitoring system";
|
|
|
|
homepage = "https://github.com/prometheus/alertmanager";
|
2022-12-28 21:21:41 +00:00
|
|
|
changelog = "https://github.com/prometheus/alertmanager/blob/v${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2020-06-18 07:06:33 +00:00
|
|
|
maintainers = with maintainers; [ benley fpletz globin Frostman ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|