Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

102 lines
2.3 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
fetchYarnDeps,
fixup-yarn-lock,
nodejs,
nodejs-slim,
matrix-sdk-crypto-nodejs,
nixosTests,
nix-update-script,
yarn,
}:
let
pname = "matrix-appservice-irc";
version = "3.0.5";
src = fetchFromGitHub {
owner = "matrix-org";
repo = "matrix-appservice-irc";
tag = version;
hash = "sha256-R/Up4SNWl2AAaeyPJe6OOKFrwIOIvDw/guJxgBuZNC4=";
};
yarnOfflineCache = fetchYarnDeps {
name = "${pname}-${version}-offline-cache";
yarnLock = "${src}/yarn.lock";
hash = "sha256-EJJyGVM4WMVQFWcTjgKHvRFWn40sXNi/vg/bypJ1hMU=";
};
in
stdenv.mkDerivation {
inherit
pname
version
src
yarnOfflineCache
;
strictDeps = true;
nativeBuildInputs = [
fixup-yarn-lock
nodejs-slim
yarn
nodejs.pkgs.node-gyp-build
];
configurePhase = ''
runHook preConfigure
export HOME=$(mktemp -d)
yarn config --offline set yarn-offline-mirror "$yarnOfflineCache"
fixup-yarn-lock yarn.lock
yarn install --frozen-lockfile --offline --no-progress --non-interactive --ignore-scripts
patchShebangs node_modules/ bin/
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
yarn --offline build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir $out
cp package.json $out
cp app.js config.schema.yml $out
cp -r bin lib public $out
# prune dependencies to production only
yarn install --frozen-lockfile --offline --no-progress --non-interactive --ignore-scripts --production
cp -r node_modules $out
# replace matrix-sdk-crypto-nodejs with nixos package
rm -rv $out/node_modules/@matrix-org/matrix-sdk-crypto-nodejs
ln -sv ${matrix-sdk-crypto-nodejs}/lib/node_modules/@matrix-org/matrix-sdk-crypto-nodejs $out/node_modules/@matrix-org/
runHook postInstall
'';
passthru.tests.matrix-appservice-irc = nixosTests.matrix-appservice-irc;
passthru.updateScript = nix-update-script { };
meta = {
changelog = "https://github.com/matrix-org/matrix-appservice-irc/releases/tag/${version}";
description = "Node.js IRC bridge for Matrix";
mainProgram = "matrix-appservice-irc";
maintainers = with lib.maintainers; [ rhysmdnz ];
homepage = "https://github.com/matrix-org/matrix-appservice-irc";
license = lib.licenses.asl20;
platforms = lib.platforms.linux;
};
}