nixpkgs/pkgs/development/tools/documentation/antora/default.nix

26 lines
723 B
Nix
Raw Normal View History

2019-07-23 08:10:51 +00:00
{ 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"
];
}