2021-09-04 15:18:09 +01: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 15:18:09 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ yuka ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|