nixpkgs/pkgs/development/tools/documentation/antora/default.nix
2019-07-23 10:16:15 +02:00

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"
];
}