2022-02-10 20:34: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-03-30 09:31:56 +00:00
|
|
|
version = "0.24.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit rev;
|
|
|
|
owner = "prometheus";
|
|
|
|
repo = "alertmanager";
|
2022-03-30 09:31:56 +00:00
|
|
|
sha256 = "sha256-hoCE0wD9/Sh/oBce7kCg/wG44FmMs6dAKnEYP+2sH0w=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
vendorSha256 = "sha256-ePb9qdCTEHHIV6JlbrBlaZjD5APwQuoGloO88W5S7Oc=";
|
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";
|
|
|
|
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
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|