gancioPlugins.telegram-bridge: remove mkYarnPackage usage

This commit is contained in:
TomaSajt 2024-11-05 22:51:05 +01:00
parent 6bd3ff7838
commit 10959a8288
No known key found for this signature in database
GPG Key ID: F011163C050122A1
2 changed files with 25 additions and 31 deletions

View File

@ -1,12 +1,15 @@
{
mkYarnPackage,
nodejs,
lib,
stdenv,
fetchFromGitLab,
fetchYarnDeps,
lib,
yarnConfigHook,
yarnInstallHook,
nodejs,
}:
mkYarnPackage rec {
inherit nodejs;
stdenv.mkDerivation rec {
pname = "gancio-plugin-telegram-bridge";
version = "1.0.4";
src = fetchFromGitLab {
@ -17,24 +20,31 @@ mkYarnPackage rec {
hash = "sha256-Da8PxCX1Z1dKJu9AiwdRDfb1r1P2KiZe8BClYB9Rz48=";
};
# upstream doesn't provide a yarn.lock file
postPatch = ''
cp --no-preserve=all ${./yarn.lock} ./yarn.lock
'';
offlineCache = fetchYarnDeps {
inherit yarnLock;
yarnLock = ./yarn.lock;
hash = "sha256-BcRVmVA5pnFzpg2gN/nKLzENnoEdwrE0EgulDizq8Ok=";
};
packageJSON = ./package.json;
# upstream doesn't provide a yarn.lock file
yarnLock = ./yarn.lock;
doDist = false;
nativeBuildInputs = [
yarnConfigHook
yarnInstallHook
nodejs
];
postInstall = ''
rmdir $out/bin
ln -s $out/libexec/gancio-plugin-telegram/deps/gancio-plugin-telegram/index.js $out/
ln -s $out/libexec/gancio-plugin-telegram/node_modules $out/
ln -s "$out/lib/node_modules/gancio-plugin-telegram/index.js" "$out/index.js"
ln -s "$out/lib/node_modules/gancio-plugin-telegram/node_modules" "$out/node_modules"
'';
passthru = {
inherit nodejs;
};
meta = {
description = "Telegram bridge for Gancio, republishes content to Telegram channels or groups";
homepage = "https://framagit.org/bcn.convocala/gancio-plugin-telegram-bridge";

View File

@ -1,16 +0,0 @@
{
"name": "gancio-plugin-telegram",
"version": "1.0.1",
"description": "Telegram bridge plugin for Gancio",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "AGPL-3.0-or-later",
"dependencies": {
"telegraf": "^4.8.5",
"dompurify": "^3.0.2",
"jsdom": "^21.1.0"
}
}