Files
Sam Pointon 37955437a7 fetchPnpmDeps: don't fail on empty lockfile
If the lockfile is empty, no files will be put in the output directory. 
In this case, the find invocations produce an empty list of results. 
xargs' default behaviour is to always invoke its command at least once; 
if its input is empty, then its command will not be passed any 
filenames. This produces an invocation like `chmod 555`. chmod, however, 
fails in this case, expecting an operand. So we need to tell xargs not 
to invoke its command at all in the case of empty input.
2026-04-26 19:33:22 +01:00

33 lines
488 B
Nix

{
pkgs,
stdenv,
fetchPnpmDeps,
nodejs,
pnpm_10,
pnpmConfigHook,
}:
stdenv.mkDerivation {
name = "pnpm-empty-lockfile";
src = ./.;
nativeBuildInputs = [
pnpm_10
pnpmConfigHook
];
pnpmDeps = fetchPnpmDeps {
pname = "pnpm-empty-lockfile";
fetcherVersion = 3;
pnpm = pnpm_10;
src = ./.;
hash = "sha256-u0GOAX5B1f2ANWbOezScp/eKQRRZA/JoYfQ5zLrNip4=";
};
buildPhase = ''
runHook preBuild
touch $out
runHook postBuild
'';
}