depot/third_party/nixpkgs/pkgs/tools/admin/meshcentral/default.nix
Default email 5e9e1146e1 Project import generated by Copybara.
GitOrigin-RevId: 18036c0be90f4e308ae3ebcab0e14aae0336fe42
2023-08-05 00:07:22 +02:00

41 lines
1.2 KiB
Nix

{ lib, fetchzip, yarn2nix-moretea, nodejs_18, dos2unix }:
yarn2nix-moretea.mkYarnPackage {
version = "1.1.6";
src = fetchzip {
url = "https://registry.npmjs.org/meshcentral/-/meshcentral-1.1.6.tgz";
sha256 = "03f2jyjrxmmr28949m3niwb437akyp6kg6h1m2jkaxfg5yj4hs4v";
};
patches = [ ./fix-js-include-paths.patch ];
packageJSON = ./package.json;
yarnLock = ./yarn.lock;
yarnNix = ./yarn.nix;
# 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/info/";
maintainers = [ maintainers.lheckemann ];
license = licenses.asl20;
};
}