nixpkgs/pkgs/servers/matrix-synapse/matrix-appservice-slack/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

57 lines
1.2 KiB
Nix

{ lib
, fetchFromGitHub
, fetchYarnDeps
, makeWrapper
, matrix-sdk-crypto-nodejs
, mkYarnPackage
, nodejs
}:
let
data = lib.importJSON ./pin.json;
in
mkYarnPackage rec {
inherit nodejs;
pname = "matrix-appservice-slack";
version = data.version;
packageJSON = ./package.json;
src = fetchFromGitHub {
owner = "matrix-org";
repo = "matrix-appservice-slack";
rev = data.version;
hash = 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";
mainProgram = "matrix-appservice-slack";
maintainers = with maintainers; [ beardhatcode chvp ];
license = licenses.asl20;
};
}