depot/third_party/nixpkgs/pkgs/servers/matrix-synapse/matrix-appservice-slack/default.nix
Default email 83405b6dd2 Project import generated by Copybara.
GitOrigin-RevId: ac718d02867a84b42522a0ece52d841188208f2c
2023-03-15 17:39:30 +01:00

53 lines
1.2 KiB
Nix

{ lib
, fetchFromGitHub
, fetchYarnDeps
, makeWrapper
, matrix-sdk-crypto-nodejs
, mkYarnPackage
, nodejs
}:
let
data = lib.importJSON ./pin.json;
in
mkYarnPackage rec {
pname = "matrix-appservice-slack";
version = data.version;
packageJSON = ./package.json;
src = fetchFromGitHub {
owner = "matrix-org";
repo = "matrix-appservice-slack";
rev = data.version;
sha256 = data.srcHash;
};
offlineCache = fetchYarnDeps {
yarnLock = src + "/yarn.lock";
sha256 = data.yarnHash;
};
packageResolutions = {
"@matrix-org/matrix-sdk-crypto-nodejs" = "${matrix-sdk-crypto-nodejs}/lib/node_modules/@matrix-org/matrix-sdk-crypto-nodejs";
};
nativeBuildInputs = [ makeWrapper ];
buildPhase = ''
runHook preBuild
yarn run build
runHook postBuild
'';
postInstall = ''
makeWrapper '${nodejs}/bin/node' "$out/bin/matrix-appservice-slack" --add-flags \
"$out/libexec/matrix-appservice-slack/deps/matrix-appservice-slack/lib/app.js"
'';
doDist = false;
meta = with lib; {
description = "A Matrix <--> Slack bridge";
maintainers = with maintainers; [ beardhatcode chvp ];
license = licenses.asl20;
};
}