1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-30 09:31:01 +00:00
nixpkgs/pkgs/servers/matrix-appservice-discord/default.nix
Notkea 523743157a
matrix-appservice-discord: init at 0.5.2 (#62744)
* matrix-appservice-discord: init at 0.5.2

* nixos/matrix-appservice-discord: add module
2020-06-01 08:43:38 +00:00

30 lines
979 B
Nix

{ pkgs, nodejs, stdenv }:
let
nodePackages = import ./node-composition.nix {
inherit pkgs nodejs;
inherit (stdenv.hostPlatform) system;
};
in nodePackages."matrix-appservice-discord-git+https://github.com/Half-Shot/matrix-appservice-discord.git#v0.5.2".override {
nativeBuildInputs = [ pkgs.makeWrapper ];
postInstall = ''
# compile Typescript sources
npm run build
# server wrapper
makeWrapper '${nodejs}/bin/node' "$out/bin/matrix-appservice-discord" \
--add-flags "$out/lib/node_modules/matrix-appservice-discord/build/src/discordas.js"
# admin tools wrappers
for toolPath in $out/lib/node_modules/matrix-appservice-discord/build/tools/*; do
makeWrapper '${nodejs}/bin/node' "$out/bin/matrix-appservice-discord-$(basename $toolPath .js)" \
--add-flags "$toolPath"
done
'';
# other metadata generated and inherited from ./node-package.nix
meta.maintainers = with stdenv.lib.maintainers; [ pacien ];
}