30 lines
900 B
Nix
30 lines
900 B
Nix
{pkgs ? import <nixpkgs> {
|
|
inherit system;
|
|
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-16_x"}:
|
|
|
|
let
|
|
nodePackages = import ./node-composition.nix {
|
|
inherit pkgs system nodejs;
|
|
};
|
|
override = orig: {
|
|
buildInputs = (orig.buildInputs or []) ++ (with pkgs; [ pkg-config vips glib ]);
|
|
src = contentFreeSrc;
|
|
dontNpmInstall = true;
|
|
};
|
|
contentFreeSrc = pkgs.stdenv.mkDerivation {
|
|
name = nodePackages.args.name + "-package-json";
|
|
src = pkgs.nix-gitignore.gitignoreSourcePure [
|
|
"*"
|
|
"!package.json"
|
|
"!package-lock.json"
|
|
] nodePackages.args.src;
|
|
dontBuild = true;
|
|
installPhase = "mkdir -p $out; cp -r ./* $out;";
|
|
};
|
|
in
|
|
nodePackages // (with nodePackages; {
|
|
tarball = tarball.override override;
|
|
package = package.override override;
|
|
shell = shell.override override;
|
|
nodeDependencies = nodeDependencies.override override;
|
|
})
|