{ lib, buildGoModule, fetchFromGitHub, olm }:

buildGoModule rec {
  pname = "mautrix-discord";
  version = "unstable-2022-11-04";

  src = fetchFromGitHub {
    owner = "mautrix";
    repo = "slack";
    rev = "4530ff397d08d93b673cd71da4c2a75d969ca0df";
    hash = "";
  };

  buildInputs = [ olm ];

  vendorHash = "sha256-yday2mSnPwuhXWkCG4XY7qoBl3DXHcSvzBoZbjgYz/c=";

  ldflags = [ "-s" "-w" ]; # https://github.com/NixOS/nixpkgs/issues/177698

  doCheck = false; # No tests available

  meta = with lib; {
    homepage = "https://go.mau.fi/mautrix-slack";
    description = "Matrix to Slack hybrid puppeting/relaybot bridge";
    license = licenses.agpl3Plus;
    maintainers = with maintainers; [ ];
  };
}

