Skip to content

Commit

Permalink
matrix-appservice-slack: init at 2016-12-23
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhoeg committed Apr 20, 2017
1 parent f0fac3b commit 1fb33ac
Show file tree
Hide file tree
Showing 9 changed files with 3,428 additions and 1 deletion.
61 changes: 61 additions & 0 deletions pkgs/servers/matrix/appservice-slack/default.nix
@@ -0,0 +1,61 @@
{ stdenv, lib, fetchFromGitHub, nodejs }:

with lib;

let
nodePackages = import ./nodepkgs.nix {
inherit pkgs;
inherit (stdenv) system;
};

in stdenv.mkDerivation rec {
name = "matrix-appservice-slack-${version}";
version = "2016-12-23";

src = fetchFromGitHub {
owner = "matrix-org";
repo = "matrix-appservice-slack";
rev = "f4bb800e0b112bc954d37ab8e76f7bd1540e3fc0";
sha256 = "0p3777mcspqpfb8jj8xw36m9imccxyjvd2bzpnffxmdahp2nh2wn";
};

buildInputs = [ nodejs ] ++ (with nodePackages; [
bluebird
]);

configurePhase = ''
mkdir -p node_modules/.bin
${concatStrings (map (dep: ''
test -d ${dep}/bin && (for b in $(ls ${dep}/bin); do
ln -sv -t node_modules/.bin ${dep}/bin/$b
done)
'') buildInputs)}
'';

buildPhase = ''
node make all
'';

installPhase = ''
dir=$out/lib/node_modules/matrix-appservice-slack
mkdir -p $dir $dir/.bin
cp -r app.js external lib $dir
cat <<EOF >$dir/.bin/matrix-appservice-slack
${stdenv.shell} -e
exec ${nodejs}/bin/node $dir/app.js \$@
EOF
ln -s $dir/.bin $out/bin
chmod 755 $out/bin/*
'';

meta = with lib; {
homepage = http://matrix.org;
description = "A Matrix <--> Slack bridge";
maintainers = with maintainers; [ peterhoeg ];
platforms = platforms.linux;
license = licenses.apache;
};
}
5 changes: 5 additions & 0 deletions pkgs/servers/matrix/appservice-slack/generate.sh
@@ -0,0 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nodePackages.node2nix

# node2nix -6 -c nodepkgs.nix -e ../../node-packages/node-env.nix
node2nix -6 -c nodepkgs.nix -e ./node-env.nix

0 comments on commit 1fb33ac

Please sign in to comment.