Hat tip to @[email protected] who gave me the answer on Mastodon.
buildNpmPackage
inherits from mkDerivation
, so you can just get the directory by overriding postInstall
.
buildNpmPackage rec {
npmDepsHash = "sha256-+4lLBQ+UQ2XT0wwE6jADxG1UNZjLkQCLvvN1SdiUwZY=";
pname = "mysite";
src = fs.toSource {
root = ./.;
fileset = sourceFiles;
};
postInstall = ''
cp -rv public/ $out
'';
version = "0.0.1";