mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 23:54:01 +00:00
6602f87384
Signed-off-by: Christian Albrecht <christian.albrecht@mayflower.de>
25 lines
690 B
Nix
25 lines
690 B
Nix
{ stdenv, nodePackages }:
|
|
|
|
let
|
|
linkNodeDeps = ({ pkg, deps, name ? "" }:
|
|
let
|
|
targetModule = if name != "" then name else stdenv.lib.getName pkg;
|
|
in nodePackages.${pkg}.override (oldAttrs: {
|
|
postInstall = ''
|
|
mkdir -p $out/lib/node_modules/${targetModule}/node_modules
|
|
${stdenv.lib.concatStringsSep "\n" (map (dep: ''
|
|
ln -s ${nodePackages.${dep}}/lib/node_modules/${stdenv.lib.getName dep} \
|
|
$out/lib/node_modules/${targetModule}/node_modules/${stdenv.lib.getName dep}
|
|
'') deps
|
|
)}
|
|
'';
|
|
})
|
|
);
|
|
in linkNodeDeps {
|
|
pkg = "@antora/cli";
|
|
name = "@antora/cli";
|
|
deps = [
|
|
"@antora/site-generator-default"
|
|
];
|
|
}
|