2022-04-03 23:32:57 +00:00
|
|
|
{ pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2022-04-05 02:18:57 +00:00
|
|
|
nodejs = pkgs.nodejs-16_x;
|
2022-04-03 23:32:57 +00:00
|
|
|
composition = pkgs.callPackage ./node-overrides.nix { inherit nodejs; };
|
|
|
|
inherit (composition.shell) nodeDependencies;
|
|
|
|
in
|
|
|
|
pkgs.stdenv.mkDerivation {
|
|
|
|
name = "lukegbcom-export";
|
|
|
|
src = pkgs.nix-gitignore.gitignoreSourcePure [
|
|
|
|
".next"
|
|
|
|
"out"
|
|
|
|
"build"
|
|
|
|
".pnp"
|
|
|
|
"node_modules"
|
|
|
|
".pnp.js"
|
2022-04-05 21:04:32 +00:00
|
|
|
"*.nix"
|
|
|
|
"*.sh"
|
|
|
|
"*.log"
|
|
|
|
"package.json"
|
|
|
|
"result*"
|
2022-04-03 23:32:57 +00:00
|
|
|
] ./.;
|
|
|
|
buildInputs = [ nodejs ];
|
|
|
|
buildPhase = ''
|
|
|
|
ln -s ${nodeDependencies}/lib/node_modules ./node_modules
|
|
|
|
export PATH="${nodeDependencies}/bin:$PATH"
|
|
|
|
|
|
|
|
echo Starting build
|
|
|
|
next build
|
|
|
|
|
|
|
|
echo Starting static export
|
|
|
|
next export
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
echo Done - moving to output
|
2022-04-05 02:18:57 +00:00
|
|
|
mkdir $out
|
|
|
|
cp firebase.json $out/firebase.json
|
|
|
|
cp .firebaserc $out/.firebaserc
|
|
|
|
mv out $out/out
|
2022-04-03 23:32:57 +00:00
|
|
|
'';
|
|
|
|
}
|