summaryrefslogtreecommitdiff
path: root/pkgs/mx-puppet-groupme/default.nix
diff options
context:
space:
mode:
authorParthiv Seetharaman <pachum99@myrdd.info>2022-01-16 21:29:21 -0800
committerParthiv Seetharaman <pachum99@myrdd.info>2022-01-16 21:44:42 -0800
commit8c05a809d70aeeb6c6e23d405ba693040ad00730 (patch)
tree70cc604e5eeb943e15c925f8e0c4d6d1eae8ed7c /pkgs/mx-puppet-groupme/default.nix
init the module, README, packages, and other stuff
Diffstat (limited to 'pkgs/mx-puppet-groupme/default.nix')
-rw-r--r--pkgs/mx-puppet-groupme/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/mx-puppet-groupme/default.nix b/pkgs/mx-puppet-groupme/default.nix
new file mode 100644
index 0000000..56971f9
--- /dev/null
+++ b/pkgs/mx-puppet-groupme/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchFromGitLab, pkgs, lib, nodejs, nodePackages, pkg-config, libjpeg
+, pixman, cairo, pango }:
+
+let
+ # No official version ever released
+ src = fetchFromGitLab {
+ owner = "robintown";
+ repo = "mx-puppet-groupme";
+ rev = "695f97c3ab834403489bb01517d433498118e482";
+ sha256 = "sha256-GPCI1eELNmijBTCdSUi0tnW0XWDPsTCZhEQud5cMBII=";
+ };
+
+ myNodePackages = import ./node-composition.nix {
+ inherit pkgs nodejs;
+ inherit (stdenv.hostPlatform) system;
+ };
+
+in myNodePackages.package.override {
+ pname = "mx-puppet-groupme";
+
+ inherit src;
+ nativeBuildInputs = [ nodePackages.node-pre-gyp pkg-config ];
+ buildInputs = [ nodePackages.typescript 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-groupme/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-groupme
+ #!/bin/sh
+ exec ${nodejs}/bin/node $out/lib/node_modules/mx-puppet-groupme/build/index.js "\$@"
+ EOF
+ chmod +x $out/bin/mx-puppet-groupme
+ '';
+
+ meta = with lib; {
+ description = "A puppeting Matrix bridge for GroupMe built with mx-puppet-bridge";
+ license = licenses.asl20;
+ homepage = "https://gitlab.com/robintown/mx-puppet-groupme";
+ maintainers = with maintainers; [ pacman99 ];
+ platforms = platforms.unix;
+ };
+}