perlPackages.NetAsyncWebSocket: 0.13 -> 0.14 (#352432)
[NixPkgs.git] / pkgs / servers / monitoring / prometheus / alertmanager.nix
blob57d8823e9787762dc2ab30f8f93a62498e3beb38
2   lib,
3   go,
4   buildGoModule,
5   fetchFromGitHub,
6   installShellFiles,
7   nixosTests,
8 }:
10 buildGoModule rec {
11   pname = "alertmanager";
12   version = "0.27.0";
13   rev = "v${version}";
15   src = fetchFromGitHub {
16     inherit rev;
17     owner = "prometheus";
18     repo = "alertmanager";
19     hash = "sha256-soE2D/PLesV1+Kif9myB54a9zIFIa94i0BrmywJPTbI=";
20   };
22   vendorHash = "sha256-zkHIdEdAy44iV2F929NB3ISuUbxdecaeZcsNQQGd06E=";
24   subPackages = [
25     "cmd/alertmanager"
26     "cmd/amtool"
27   ];
29   ldflags =
30     let
31       t = "github.com/prometheus/common/version";
32     in
33     [
34       "-X ${t}.Version=${version}"
35       "-X ${t}.Revision=${src.rev}"
36       "-X ${t}.Branch=unknown"
37       "-X ${t}.BuildUser=nix@nixpkgs"
38       "-X ${t}.BuildDate=unknown"
39       "-X ${t}.GoVersion=${lib.getVersion go}"
40     ];
42   nativeBuildInputs = [ installShellFiles ];
44   postInstall = ''
45     $out/bin/amtool --completion-script-bash > amtool.bash
46     installShellCompletion amtool.bash
47     $out/bin/amtool --completion-script-zsh > amtool.zsh
48     installShellCompletion amtool.zsh
49   '';
51   passthru.tests = { inherit (nixosTests.prometheus) alertmanager; };
53   meta = with lib; {
54     description = "Alert dispatcher for the Prometheus monitoring system";
55     homepage = "https://github.com/prometheus/alertmanager";
56     changelog = "https://github.com/prometheus/alertmanager/blob/v${version}/CHANGELOG.md";
57     license = licenses.asl20;
58     maintainers = with maintainers; [
59       benley
60       fpletz
61       globin
62       Frostman
63     ];
64   };