depot/web/lukegbcom/default.nix

33 lines
695 B
Nix

{ pkgs, ... }:
let
nodejs = pkgs.nodejs-12_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
mv out $out
'';
}