52 lines
1.0 KiB
Nix
52 lines
1.0 KiB
Nix
{
|
|
bun,
|
|
stdenvNoCC,
|
|
nix-gitignore,
|
|
writableTmpDirAsHomeHook,
|
|
}:
|
|
stdenvNoCC.mkDerivation {
|
|
name = "node-modules";
|
|
|
|
nativeBuildInputs = [
|
|
bun
|
|
writableTmpDirAsHomeHook
|
|
];
|
|
|
|
src = nix-gitignore.gitignoreSource [ ] ../../.;
|
|
|
|
dontConfigure = true;
|
|
|
|
# Required else we get errors that our fixed-output derivation references store paths
|
|
dontFixup = true;
|
|
|
|
# Only install dependencies, don't build
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
|
|
export BUN_INSTALL_CACHE_DIR=$(mktemp -d)
|
|
|
|
# Disable post-install scripts to avoid shebang issues
|
|
bun install \
|
|
--frozen-lockfile \
|
|
--ignore-scripts \
|
|
--backend copyfile \
|
|
--no-progress \
|
|
--force
|
|
|
|
runHook postBuild
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out
|
|
cp -r node_modules $out/
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
outputHashMode = "recursive";
|
|
outputHashAlgo = "sha256";
|
|
# NOTE: Empty this when a new dependency is added
|
|
outputHash = "sha256-T9X1EFeoNV3yKdVUIMOvaYtja6XR0fne6CDkKHD5rhE=";
|
|
} |