depot/third_party/nixpkgs/pkgs/tools/admin/meshcentral/default.nix
Default email 23b612e36f Project import generated by Copybara.
GitOrigin-RevId: ae5c332cbb5827f6b1f02572496b141021de335f
2024-01-25 23:12:00 +09:00

51 lines
1.3 KiB
Nix

{ lib
, fetchzip
, fetchYarnDeps
, yarn2nix-moretea
, nodejs_18
, dos2unix
}:
yarn2nix-moretea.mkYarnPackage {
version = "1.1.19";
src = fetchzip {
url = "https://registry.npmjs.org/meshcentral/-/meshcentral-1.1.19.tgz";
sha256 = "0kphzzhzc29jmldbfdfczw0395a1kr38bpyz0hjl9hm0d6glz74h";
};
patches = [ ./fix-js-include-paths.patch ];
packageJSON = ./package.json;
yarnLock = ./yarn.lock;
offlineCache = fetchYarnDeps {
yarnLock = ./yarn.lock;
hash = "sha256-tKS7Nrd5tWuRFfl5hZXCmVBxUe+W3+uhtw0YF0IBGZU=";
};
# 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
sed -i '1i#!${nodejs_18}/bin/node' $out/libexec/meshcentral/deps/meshcentral/meshcentral.js
ln -s $out/libexec/meshcentral/deps/meshcentral/meshcentral.js $out/bin/meshcentral
'';
publishBinsFor = [ ];
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "Computer management web app";
homepage = "https://meshcentral.com/";
maintainers = with maintainers; [ ma27 ];
license = licenses.asl20;
};
}