mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-03 19:43:30 +00:00
26 lines
723 B
Nix
26 lines
723 B
Nix
|
{ stdenv, nodePackages_10_x }:
|
||
|
|
||
|
let
|
||
|
drvName = drv: (builtins.parseDrvName drv).name;
|
||
|
linkNodeDeps = ({ pkg, deps, name ? "" }:
|
||
|
let
|
||
|
targetModule = if name != "" then name else drvName pkg;
|
||
|
in nodePackages_10_x.${pkg}.override (oldAttrs: {
|
||
|
postInstall = ''
|
||
|
mkdir -p $out/lib/node_modules/${targetModule}/node_modules
|
||
|
${stdenv.lib.concatStringsSep "\n" (map (dep: ''
|
||
|
ln -s ${nodePackages_10_x.${dep}}/lib/node_modules/${drvName dep} \
|
||
|
$out/lib/node_modules/${targetModule}/node_modules/${drvName dep}
|
||
|
'') deps
|
||
|
)}
|
||
|
'';
|
||
|
})
|
||
|
);
|
||
|
in linkNodeDeps {
|
||
|
pkg = "@antora/cli";
|
||
|
name = "@antora/cli";
|
||
|
deps = [
|
||
|
"@antora/site-generator-default"
|
||
|
];
|
||
|
}
|