depot/web/lukegbcom/node-overrides.nix

31 lines
900 B
Nix
Raw Permalink Normal View History

2022-04-03 23:32:57 +00:00
{pkgs ? import <nixpkgs> {
inherit system;
2022-04-05 02:18:57 +00:00
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-16_x"}:
2022-04-03 23:32:57 +00:00
let
nodePackages = import ./node-composition.nix {
inherit pkgs system nodejs;
};
override = orig: {
buildInputs = (orig.buildInputs or []) ++ (with pkgs; [ pkg-config vips glib ]);
src = contentFreeSrc;
2022-04-05 02:18:57 +00:00
dontNpmInstall = true;
2022-04-03 23:32:57 +00:00
};
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;
})