diff options
author | Parthiv Seetharaman <pachum99@myrdd.info> | 2022-01-16 21:29:21 -0800 |
---|---|---|
committer | Parthiv Seetharaman <pachum99@myrdd.info> | 2022-01-16 21:44:42 -0800 |
commit | 8c05a809d70aeeb6c6e23d405ba693040ad00730 (patch) | |
tree | 70cc604e5eeb943e15c925f8e0c4d6d1eae8ed7c /pkgs/mx-puppet-slack/default.nix |
init the module, README, packages, and other stuff
Diffstat (limited to 'pkgs/mx-puppet-slack/default.nix')
-rw-r--r-- | pkgs/mx-puppet-slack/default.nix | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/pkgs/mx-puppet-slack/default.nix b/pkgs/mx-puppet-slack/default.nix new file mode 100644 index 0000000..ddc4ef2 --- /dev/null +++ b/pkgs/mx-puppet-slack/default.nix @@ -0,0 +1,59 @@ +{ stdenv +, fetchFromGitHub +, pkgs +, lib +, nodejs +, nodePackages +, pkg-config +, libjpeg +, pixman +, cairo +, pango +}: + +let + # No official version ever released + src = fetchFromGitHub { + owner = "Sorunome"; + repo = pname; + rev = "691e53d2d703bd169e1f23a8d8dff3f008d8c4ef"; + sha256 = "sha256-cjRmlVCk6jX+CCQiAc/dcormPLe/BafBJeRHCv6Mu1k="; + }; + + myNodePackages = import ./node-composition.nix { + inherit pkgs nodejs; + inherit (stdenv.hostPlatform) system; + }; + + pname = "mx-puppet-slack"; + +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/${pname}/node_modules/" + # compile Typescript sources + npm run build + # Make an executable to run the server + mkdir -p $out/bin + cat <<EOF > $out/bin/${pname} + #!/bin/sh + exec ${nodejs}/bin/node $out/lib/node_modules/${pname}/build/index.js "\$@" + EOF + chmod +x $out/bin/${pname} + ''; + + meta = with lib; { + description = "A slack puppeting bridge for matrix"; + license = licenses.asl20; + homepage = "https://github.com/Sorunome/mx-puppet-slack"; + maintainers = with maintainers; [ pacman99 ]; + platforms = platforms.unix; + }; +} |