nixpkgs/pkgs/servers/monitoring/matrix-alertmanager/default.nix

40 lines
1.1 KiB
Nix
Raw Normal View History

2021-09-04 14:18:09 +00:00
{ lib, callPackage, mkYarnPackage, fetchYarnDeps, fetchFromGitHub, nodejs }:
mkYarnPackage rec {
pname = "matrix-alertmanager";
version = "0.5.0";
src = fetchFromGitHub {
owner = "jaywink";
repo = pname;
rev = "v${version}";
sha256 = "M3/8viRCRiVJGJSHidP6nG8cr8wOl9hMFY/gzdSRN+4=";
};
packageJSON = ./package.json;
yarnLock = ./yarn.lock;
offlineCache = fetchYarnDeps {
inherit yarnLock;
sha256 = lib.fileContents ./yarn-hash;
};
prePatch = ''
cp ${./package.json} ./package.json
'';
postInstall = ''
sed '1 s;^;#!${nodejs}/bin/node\n;' -i $out/libexec/matrix-alertmanager/node_modules/matrix-alertmanager/src/app.js
chmod +x $out/libexec/matrix-alertmanager/node_modules/matrix-alertmanager/src/app.js
'';
passthru.updateScript = callPackage ./update.nix {};
meta = with lib; {
description = "Bot to receive Alertmanager webhook events and forward them to chosen rooms";
2021-12-07 10:44:28 +00:00
homepage = "https://github.com/jaywink/matrix-alertmanager";
2021-09-04 14:18:09 +00:00
license = licenses.mit;
maintainers = with maintainers; [ yuka ];
platforms = platforms.all;
};
}