depot/web/lukegbcom/node-overrides.nix

29 lines
873 B
Nix

{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_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;
};
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;
})