36 lines
790 B
Nix
36 lines
790 B
Nix
{ pkgs, ... }:
|
|
|
|
let
|
|
nodejs = pkgs.nodejs-16_x;
|
|
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"
|
|
] ./.;
|
|
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
|
|
mkdir $out
|
|
cp firebase.json $out/firebase.json
|
|
cp .firebaserc $out/.firebaserc
|
|
mv out $out/out
|
|
'';
|
|
}
|