depot/third_party/nixpkgs/pkgs/servers/matrix-synapse/matrix-appservice-irc/default.nix
Default email bba55970ba Project import generated by Copybara.
GitOrigin-RevId: 3d1a7716d7f1fccbd7d30ab3b2ed3db831f43bde
2021-04-05 17:23:46 +02:00

28 lines
950 B
Nix

{ pkgs, nodePackages, makeWrapper, nixosTests, nodejs, stdenv, lib, ... }:
let
packageName = with lib; concatStrings (map (entry: (concatStrings (mapAttrsToList (key: value: "${key}-${value}") entry))) (importJSON ./package.json));
ourNodePackages = import ./node-composition.nix {
inherit pkgs nodejs;
inherit (stdenv.hostPlatform) system;
};
in
ourNodePackages."${packageName}".override {
nativeBuildInputs = [ makeWrapper nodePackages.node-gyp-build ];
postInstall = ''
makeWrapper '${nodejs}/bin/node' "$out/bin/matrix-appservice-irc" \
--add-flags "$out/lib/node_modules/matrix-appservice-irc/app.js"
'';
passthru.tests.matrix-appservice-irc = nixosTests.matrix-appservice-irc;
meta = with lib; {
description = "Node.js IRC bridge for Matrix";
maintainers = with maintainers; [ piegames ];
homepage = "https://github.com/matrix-org/matrix-appservice-irc";
license = licenses.asl20;
};
}