# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0

{ fetchFromGitHub
, buildGoPackage
, lib
}:
let
  version = "unstable-20210223";
  src = fetchFromGitHub {
    owner = "benjojo";
    repo = "alertmanager-discord";
    rev = "c27d983dda1eca908cdb04aafe995f61a7d0ca2f";
    hash = "sha256:1ps5jxysy9w0ns7sjkp4p3109f8pl22ri24vgkfrkggf3mc1lakf";
  };
in
buildGoPackage rec {
  pname = "alertmanager-discord";
  inherit version src;

  goPackagePath = "github.com/benjojo/alertmanager-discord";

  meta = with lib; {
    homepage = "https://github.com/benjojo/alertmanager-discord";
    description = "Alertmanager Discord Webhook bridge";
    license = licenses.unfree;
    maintainers = with maintainers; [ lukegb ];
  };
}