nixpkgs/pkgs/servers/mx-puppet-discord/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitLab, pkgs, lib, nodejs-14_x, pkg-config
, libjpeg, pixman, cairo, pango, which, postgresql }:
2021-04-15 06:04:24 +02:00
let
nodejs = nodejs-14_x;
version = "0.1.1";
src = fetchFromGitLab {
group = "mx-puppet";
owner = "discord";
2021-04-15 06:04:24 +02:00
repo = "mx-puppet-discord";
rev = "v${version}";
hash = "sha256-ZhyjUt6Bz/0R4+Lq/IoY9rNjdwVE2qp4ZQLc684+T/0=";
2021-04-15 06:04:24 +02:00
};
myNodePackages = import ./node-composition.nix {
inherit pkgs nodejs;
inherit (stdenv.hostPlatform) system;
};
in myNodePackages.package.override {
inherit version src;
2021-05-23 23:46:18 +02:00
nativeBuildInputs = [ nodejs.pkgs.node-pre-gyp nodejs.pkgs.node-gyp-build pkg-config which ];
buildInputs = [ libjpeg pixman cairo pango postgresql ];
2021-04-15 06:04:24 +02:00
postRebuild = ''
# Build typescript stuff
2021-04-15 06:04:24 +02:00
npm run build
'';
2021-04-15 06:04:24 +02:00
postInstall = ''
2021-04-15 06:04:24 +02:00
# Make an executable to run the server
mkdir -p $out/bin
cat <<EOF > $out/bin/mx-puppet-discord
#!/bin/sh
exec ${nodejs}/bin/node $out/lib/node_modules/@mx-puppet/discord/build/index.js "\$@"
2021-04-15 06:04:24 +02:00
EOF
chmod +x $out/bin/mx-puppet-discord
'';
meta = with lib; {
description = "A discord puppeting bridge for matrix";
license = licenses.asl20;
homepage = "https://gitlab.com/mx-puppet/discord/mx-puppet-discord";
2021-04-15 06:04:24 +02:00
maintainers = with maintainers; [ expipiplus1 ];
platforms = platforms.unix;
};
}