|
|
@ -31,13 +31,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
packageLock = builtins.fromJSON(builtins.readFile (src + "/package-lock.json"));
|
|
|
|
packageLock = builtins.fromJSON(builtins.readFile (src + "/package-lock.json"));
|
|
|
|
|
|
|
|
|
|
|
|
deps = builtins.attrValues (removeAttrs packageLock.packages [ "" ])
|
|
|
|
deps = builtins.attrValues (removeAttrs packageLock.packages [ "" ]);
|
|
|
|
++ builtins.attrValues (removeAttrs (packageLock.dependencies or {} ) [ "" ])
|
|
|
|
depTarballs = map (p: pkgs.fetchurl { url = p.resolved; hash = p.integrity; }) deps;
|
|
|
|
;
|
|
|
|
nodeTarball = pkgs.fetchurl {
|
|
|
|
tarballs = map (p: pkgs.fetchurl { url = p.resolved; hash = p.integrity; }) deps;
|
|
|
|
url = "https://nodejs.org/download/release/v20.2.0/node-v20.2.0-headers.tar.gz";
|
|
|
|
|
|
|
|
hash = "sha256-GxkJoXnN/35mTQXnivQAa942T07t5hTCr4C6j0C3a/k=";
|
|
|
|
|
|
|
|
};
|
|
|
|
tarballsFile = pkgs.writeTextFile {
|
|
|
|
tarballsFile = pkgs.writeTextFile {
|
|
|
|
name = "tarballs";
|
|
|
|
name = "tarballs";
|
|
|
|
text = builtins.concatStringsSep "\n" tarballs;
|
|
|
|
text = (builtins.concatStringsSep "\n" depTarballs) + "\n";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
tempestdev_modules = pkgs.stdenv.mkDerivation {
|
|
|
|
tempestdev_modules = pkgs.stdenv.mkDerivation {
|
|
|
@ -45,23 +47,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
name = "tempestdevnode_modules";
|
|
|
|
name = "tempestdevnode_modules";
|
|
|
|
|
|
|
|
|
|
|
|
buildInputs = [ nodejs ];
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
|
|
|
nodejs
|
|
|
|
|
|
|
|
pkgs.nodePackages.node-gyp
|
|
|
|
|
|
|
|
pkgs.vips
|
|
|
|
|
|
|
|
pkgs.pkg-config
|
|
|
|
|
|
|
|
pkgs.python3
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
buildPhase = ''
|
|
|
|
export HOME=$PWD/.home
|
|
|
|
export HOME=$PWD/.home
|
|
|
|
export npm_config_cache=$PWD/.npm
|
|
|
|
export npm_config_cache=$PWD/.npm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Caching Node headers"
|
|
|
|
|
|
|
|
${pkgs.nodePackages.node-gyp}/bin/node-gyp install v20.2.0 --tarball=${nodeTarball}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Caching NPM dependencies"
|
|
|
|
while read package
|
|
|
|
while read package
|
|
|
|
do
|
|
|
|
do
|
|
|
|
echo "caching $(echo $package | sed 's/\/nix\/store\/[^-]*-//')"
|
|
|
|
|
|
|
|
npm cache add "$package"
|
|
|
|
npm cache add "$package"
|
|
|
|
done <${tarballsFile}
|
|
|
|
done <${tarballsFile}
|
|
|
|
|
|
|
|
|
|
|
|
${nodejs}/bin/npm --cache-min 99999999 ci --no-registry
|
|
|
|
${nodejs}/bin/npm --offline ci --no-registry
|
|
|
|
'';
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
|
|
|
mkdir $out
|
|
|
|
|
|
|
|
sed --in-place 's|/usr/bin/env node|${nodejs}/bin/node|' ./node_modules/next/dist/bin/next
|
|
|
|
mv node_modules $out/node_modules
|
|
|
|
mv node_modules $out/node_modules
|
|
|
|
'';
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|