2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, fetchzip
|
|
|
|
, fetchYarnDeps
|
|
|
|
, yarn2nix-moretea
|
|
|
|
, nodejs_18
|
|
|
|
, dos2unix
|
|
|
|
}:
|
2021-08-12 14:41:47 +00:00
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
yarn2nix-moretea.mkYarnPackage {
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "1.1.19";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
src = fetchzip {
|
2024-01-25 14:12:00 +00:00
|
|
|
url = "https://registry.npmjs.org/meshcentral/-/meshcentral-1.1.19.tgz";
|
|
|
|
sha256 = "0kphzzhzc29jmldbfdfczw0395a1kr38bpyz0hjl9hm0d6glz74h";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
patches = [ ./fix-js-include-paths.patch ];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
packageJSON = ./package.json;
|
|
|
|
yarnLock = ./yarn.lock;
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
yarnLock = ./yarn.lock;
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-tKS7Nrd5tWuRFfl5hZXCmVBxUe+W3+uhtw0YF0IBGZU=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
# Tarball has CRLF line endings. This makes patching difficult, so let's convert them.
|
|
|
|
nativeBuildInputs = [ dos2unix ];
|
|
|
|
prePatch = ''
|
|
|
|
find . -name '*.js' -exec dos2unix {} +
|
|
|
|
ln -snf meshcentral.js bin/meshcentral
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
chmod a+x $out/libexec/meshcentral/deps/meshcentral/meshcentral.js
|
2023-05-24 13:37:59 +00:00
|
|
|
sed -i '1i#!${nodejs_18}/bin/node' $out/libexec/meshcentral/deps/meshcentral/meshcentral.js
|
2021-08-05 21:33:18 +00:00
|
|
|
ln -s $out/libexec/meshcentral/deps/meshcentral/meshcentral.js $out/bin/meshcentral
|
|
|
|
'';
|
|
|
|
|
|
|
|
publishBinsFor = [ ];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Computer management web app";
|
2023-10-09 19:29:22 +00:00
|
|
|
homepage = "https://meshcentral.com/";
|
2024-01-25 14:12:00 +00:00
|
|
|
maintainers = with maintainers; [ ma27 ];
|
2021-08-05 21:33:18 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|