buildNpmPackage: use installManPage

This commit is contained in:
Robert Schütz 2023-08-18 21:07:39 -07:00
parent d84e7a36ca
commit 96e5dce777
2 changed files with 5 additions and 3 deletions

View file

@ -27,7 +27,10 @@
npmInstallHook = makeSetupHook
{
name = "npm-install-hook";
propagatedBuildInputs = [ buildPackages.makeWrapper ];
propagatedBuildInputs = with buildPackages; [
installShellFiles
makeWrapper
];
substitutions = {
hostNode = "${nodejs}/bin/node";
jq = "${buildPackages.jq}/bin/jq";

View file

@ -25,8 +25,7 @@ npmInstallHook() {
else "invalid type " + $typ | halt_error end' "${npmWorkspace-.}/package.json")
while IFS= read -r man; do
mkdir -p "$out/share/man"
ln -s "$packageOut/$man" "$out/share/man"
installManPage "$packageOut/$man"
done < <(@jq@ --raw-output '(.man | type) as $typ | if $typ == "string" then .man
elif $typ == "list" then .man | join("\n")
else "invalid type " + $typ | halt_error end' "${npmWorkspace-.}/package.json")