Open djacu opened 1 year ago
I was able to get sharp
to work with the system libvips
by explicitly adding sharp
as a dependency and using
node_modules_attrs = {
buildInputs = with pkgs; [ vips ];
nativeBuildInputs = with pkgs; [ pkg-config python3 ];
postBuild = ''
npm rebuild sharp --nodedir=${nodeSource pkgs.nodejs_20}
'';
};
to trigger the build scripts.
with nodeSource
copied from npmlock2nix
:
nodeSource = nodejs: pkgs.runCommand "node-sources-${nodejs.version}"
{ } ''
tar --no-same-owner --no-same-permissions -xf ${nodejs.src}
mv node-* $out
'';
I am trying to package an astro theme to use for a personal website and the theme depends on
sharp
.I found #162 and that gave me a tip for setting the
npm_config_sharp_libvips_local_prebuilds
environment variable because it was trying to fetch sources during the install. But now the error it returns has me stuck.Seems like these two are offending lines and are related but it is in the package file so I'm not sure why it cannot be found.
Any advice?
short log:
full log:
Relevant flake: