mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 07:00:43 +00:00
mx-puppet-discord: init at 2021-01-22
This commit is contained in:
parent
a64b9f2b10
commit
e14e57fb19
45
pkgs/servers/mx-puppet-discord/default.nix
Normal file
45
pkgs/servers/mx-puppet-discord/default.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{ stdenv, fetchFromGitHub, pkgs, lib, nodejs, nodePackages, pkg-config, libjpeg
|
||||
, pixman, cairo, pango }:
|
||||
|
||||
let
|
||||
# No official version ever released
|
||||
src = fetchFromGitHub {
|
||||
owner = "matrix-discord";
|
||||
repo = "mx-puppet-discord";
|
||||
rev = "c17384a6a12a42a528e0b1259f8073e8db89b8f4";
|
||||
sha256 = "1yczhfpa4qzvijcpgc2pr10s009qb6jwlfwpcbb17g2wsx6zj0c2";
|
||||
};
|
||||
|
||||
myNodePackages = import ./node-composition.nix {
|
||||
inherit pkgs nodejs;
|
||||
inherit (stdenv.hostPlatform) system;
|
||||
};
|
||||
|
||||
in myNodePackages.package.override {
|
||||
inherit src;
|
||||
nativeBuildInputs = [ nodePackages.node-pre-gyp pkg-config ];
|
||||
buildInputs = [ libjpeg pixman cairo pango ];
|
||||
|
||||
postInstall = ''
|
||||
# Patch shebangs in node_modules, otherwise the webpack build fails with interpreter problems
|
||||
patchShebangs --build "$out/lib/node_modules/mx-puppet-discord/node_modules/"
|
||||
# compile Typescript sources
|
||||
npm run build
|
||||
|
||||
# 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 "\$@"
|
||||
EOF
|
||||
chmod +x $out/bin/mx-puppet-discord
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A discord puppeting bridge for matrix";
|
||||
license = licenses.asl20;
|
||||
homepage = "https://github.com/matrix-discord/mx-puppet-discord";
|
||||
maintainers = with maintainers; [ expipiplus1 ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
21
pkgs/servers/mx-puppet-discord/generate.sh
Executable file
21
pkgs/servers/mx-puppet-discord/generate.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p nodePackages.node2nix
|
||||
|
||||
# No official release
|
||||
rev=c17384a6a12a42a528e0b1259f8073e8db89b8f4
|
||||
u=https://raw.githubusercontent.com/matrix-discord/mx-puppet-discord/$rev
|
||||
# Download package.json and package-lock.json
|
||||
curl -O $u/package.json
|
||||
curl -O $u/package-lock.json
|
||||
|
||||
node2nix \
|
||||
--nodejs-12 \
|
||||
--node-env ../../development/node-packages/node-env.nix \
|
||||
--input package.json \
|
||||
--lock package-lock.json \
|
||||
--output node-packages.nix \
|
||||
--composition node-composition.nix
|
||||
|
||||
sed -i 's|<nixpkgs>|../../..|' node-composition.nix
|
||||
|
||||
rm -f package.json package-lock.json
|
17
pkgs/servers/mx-puppet-discord/node-composition.nix
Normal file
17
pkgs/servers/mx-puppet-discord/node-composition.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
# This file has been generated by node2nix 1.9.0. Do not edit!
|
||||
|
||||
{pkgs ? import ../../.. {
|
||||
inherit system;
|
||||
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}:
|
||||
|
||||
let
|
||||
nodeEnv = import ../../development/node-packages/node-env.nix {
|
||||
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
|
||||
inherit pkgs nodejs;
|
||||
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
|
||||
};
|
||||
in
|
||||
import ./node-packages.nix {
|
||||
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
|
||||
inherit nodeEnv;
|
||||
}
|
3616
pkgs/servers/mx-puppet-discord/node-packages.nix
generated
Normal file
3616
pkgs/servers/mx-puppet-discord/node-packages.nix
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -6099,6 +6099,8 @@ in
|
|||
|
||||
multitail = callPackage ../tools/misc/multitail { };
|
||||
|
||||
mx-puppet-discord = callPackage ../servers/mx-puppet-discord { };
|
||||
|
||||
mxt-app = callPackage ../misc/mxt-app { };
|
||||
|
||||
mxisd = callPackage ../servers/mxisd { };
|
||||
|
|
Loading…
Reference in a new issue