Files
nixpkgs/pkgs/tools/admin/meshcentral/default.nix
T
Maximilian Bosch 232fe85fd4 meshcentral: make reproducible
Closes #472246

While there's a refactoring of the package ongoing (#460508), the fix is
trivial enough.
2025-12-21 19:16:45 +01:00

58 lines
1.4 KiB
Nix

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