2023-08-24 18:27:05 +07:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildNpmPackage
|
|
|
|
, nodejs
|
|
|
|
}:
|
|
|
|
|
2023-11-19 01:31:01 +07:00
|
|
|
buildNpmPackage {
|
|
|
|
pname = "scanservjs";
|
|
|
|
version = "3.0.3";
|
|
|
|
|
2023-08-24 18:27:05 +07:00
|
|
|
src = fetchFromGitHub {
|
2023-11-19 01:31:01 +07:00
|
|
|
# owner = "sbs20";
|
|
|
|
owner = "chayleaf";
|
2023-08-24 18:27:05 +07:00
|
|
|
repo = "scanservjs";
|
2023-11-19 01:31:01 +07:00
|
|
|
# rev = "v${version}";
|
|
|
|
rev = "bf41a95c9cd6bd924d6e14a28da6d33ddc64ef2e";
|
|
|
|
hash = "sha256-ePg8spI1rlWYcpjtax7gaZp2wUX4beHzMd71b8XKNG8=";
|
2023-08-24 18:27:05 +07:00
|
|
|
};
|
|
|
|
|
2023-11-19 01:31:01 +07:00
|
|
|
inherit nodejs;
|
2023-08-24 18:27:05 +07:00
|
|
|
|
2023-11-19 01:31:01 +07:00
|
|
|
npmDepsHash = "sha256-bigIFAQ2RLk6yxbUcMnmXwgaEkzFFUYn+hE7RIiFm8Y=";
|
2023-08-24 18:27:05 +07:00
|
|
|
|
|
|
|
preBuild = ''
|
2023-11-19 01:31:01 +07:00
|
|
|
npm run build
|
2023-08-24 18:27:05 +07:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2023-11-19 01:31:01 +07:00
|
|
|
mv $out/lib/node_modules/scanservjs/node_modules dist/
|
|
|
|
rm -rf $out/lib/node_modules/scanservjs
|
|
|
|
mv dist $out/lib/node_modules/scanservjs
|
2023-08-24 18:27:05 +07:00
|
|
|
mkdir -p $out/bin
|
|
|
|
makeWrapper ${nodejs}/bin/node $out/bin/scanservjs \
|
|
|
|
--set NODE_ENV production \
|
2023-11-19 01:31:01 +07:00
|
|
|
--add-flags "'$out/lib/node_modules/scanservjs/server/server.js'"
|
2023-08-24 18:27:05 +07:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "SANE scanner nodejs web ui";
|
|
|
|
longDescription = "scanservjs is a simple web-based UI for SANE which allows you to share a scanner on a network without the need for drivers or complicated installation.";
|
|
|
|
homepage = "https://github.com/sbs20/scanservjs";
|
|
|
|
license = licenses.gpl2Only;
|
|
|
|
mainProgram = "scanservjs";
|
|
|
|
maintainers = with maintainers; [ chayleaf ];
|
|
|
|
};
|
|
|
|
}
|