2023-02-10 21:02:05 +00:00
|
|
|
{ depot, pkgs, ... }:
|
2022-04-03 23:32:57 +00:00
|
|
|
|
|
|
|
let
|
2023-05-27 20:26:37 +00:00
|
|
|
nodejs = pkgs.nodejs-18_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 ];
|
2023-02-10 21:02:05 +00:00
|
|
|
postPatch = let
|
|
|
|
f0Firmware = depot.nix.pkgs.flipperzero-firmware;
|
|
|
|
in ''
|
|
|
|
sed -i \
|
|
|
|
-e 's/__FLIPPER_FIRMWARE_NAME__/${f0Firmware.name}/g' \
|
|
|
|
-e 's/__FLIPPER_FIRMWARE_VERSION__/${f0Firmware.version}/g' \
|
|
|
|
-e 's/__FLIPPER_UPSTREAM_VERSION__/${f0Firmware.upstreamVersion}/g' \
|
|
|
|
pages/tools.js
|
|
|
|
'';
|
2022-04-03 23:32:57 +00:00
|
|
|
buildPhase = ''
|
|
|
|
ln -s ${nodeDependencies}/lib/node_modules ./node_modules
|
|
|
|
export PATH="${nodeDependencies}/bin:$PATH"
|
2023-05-27 20:26:37 +00:00
|
|
|
export NODE_OPTIONS="--no-experimental-fetch"
|
2022-04-03 23:32:57 +00:00
|
|
|
|
|
|
|
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
|
|
|
'';
|
|
|
|
}
|