-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why are *.nix files not enough and why building the package requires package.json in current directory? #305
Comments
The reason that you need |
But shouldn't then the file be embedded into a Also, my understanding is that running |
In fact, I think there is even a bigger problem here. First, this program creates For example |
the error
comes from {
nodeDependencies = nodeEnv.buildNodeDependencies (lib.overrideExisting args {
src = stdenv.mkDerivation {
name = args.name + "-package-json";
src = nix-gitignore.gitignoreSourcePure [
"*"
"!package.json"
"!package-lock.json"
] args.src;
dontBuild = true;
installPhase = "mkdir -p $out; cp -r ./* $out;";
};
}); the {
installPhase = ''
mkdir $out
cp -v package.json $out
[ -f package-lock.json ] && cp -v package-lock.json $out
''; now it says
|
So I generated *.nix files using
node2nix --lock package-lock.json --nodejs-16 --composition node.nix --development
and I expected that only *.nix files are needed and all information frompackage-lock.json
has been taken in. But to my surprise, if I runnix-build -E 'with import <nixpkgs> { }; callPackage ./default.nix { }'
I get cryptic:The reason is,
package.json
is needed at Nix package build time. That is a surprise. It is not defined as input anywhere in Nix packages. Why it is needed? Can this be documented somewhere? Have I missed something?Example you can try running (it also does more stuff, like builds some Go stuff): https://gitlab.com/peerdb/search/-/jobs/3107194318/artifacts/browse
The text was updated successfully, but these errors were encountered: