nixpkgs/pkgs/tools/admin/meshcentral/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.2 KiB
Nix
Raw Normal View History

2022-11-29 13:28:54 +00:00
{ lib, fetchpatch, fetchzip, yarn2nix-moretea, nodejs-16_x, jq, dos2unix }:
2021-08-11 09:59:42 +00:00
2022-11-29 13:28:54 +00:00
yarn2nix-moretea.mkYarnPackage {
version = "1.1.0";
2021-07-21 08:20:58 +00:00
src = fetchzip {
2022-11-29 13:28:54 +00:00
url = "https://registry.npmjs.org/meshcentral/-/meshcentral-1.1.0.tgz";
sha256 = "1g7wgph35h8vi44yn4niv1jq2d8v9xrwps9k4bfjyd6470gg2sfc";
2021-07-21 08:20:58 +00:00
};
2022-11-29 13:28:54 +00:00
patches = [ ./fix-js-include-paths.patch ];
2021-07-21 08:20:58 +00:00
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
2022-11-29 13:28:54 +00:00
sed -i '1i#!${nodejs-16_x}/bin/node' $out/libexec/meshcentral/deps/meshcentral/meshcentral.js
2021-07-21 08:20:58 +00:00
ln -s $out/libexec/meshcentral/deps/meshcentral/meshcentral.js $out/bin/meshcentral
'';
publishBinsFor = [ ];
passthru.updateScript = ./update.sh;
2021-07-21 08:20:58 +00:00
meta = with lib; {
description = "Computer management web app";
homepage = "https://meshcentral.com/info/";
maintainers = [ maintainers.lheckemann ];
license = licenses.asl20;
};
}