Files
imphnen-frontend-service/nix/landing.nix
T
maulanasdqnandClaude Opus 4.6 bbb1bae909 chore: migrate to Nix flakes, remove Docker and legacy configs
Remove all Docker files, Vercel config, Verdaccio, and old CI workflow.
Standardize on nodejs_22 across devShell and nix build helpers.
Update CI to build all packages and push to Cachix on merge to develop.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 23:05:37 +07:00

59 lines
1.5 KiB
Nix

# Next.js Landing App Package
{ pkgs, src, npmDepsHash }:
pkgs.buildNpmPackage {
pname = "imphnen-landing";
version = "0.0.1";
inherit src npmDepsHash;
npmFlags = [ "--legacy-peer-deps" ];
makeCacheWritable = true;
nativeBuildInputs = with pkgs; [
nodejs_22
python3 # Required for node-gyp (sharp, etc.)
];
buildPhase = ''
runHook preBuild
export NX_DAEMON=false
export HOME=$TMPDIR
export CI=true
export NO_COLOR=1
export TERM=dumb
export NX_SKIP_NX_CACHE=true
export NX_TASKS_RUNNER_DYNAMIC_OUTPUT=false
export NX_NATIVE=false
./node_modules/.bin/nx build landing --output-style=static
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/landing
# Copy standalone server
cp -r dist/apps/landing/.next/standalone/* $out/share/landing/
# Copy public assets
mkdir -p $out/share/landing/apps/landing/public
cp -r dist/apps/landing/public/* $out/share/landing/apps/landing/public/ || true
# Copy static files
mkdir -p $out/share/landing/dist/apps/landing/.next/static
cp -r dist/apps/landing/.next/static/* $out/share/landing/dist/apps/landing/.next/static/
# Create wrapper script
cat > $out/bin/imphnen-landing <<EOF
#!${pkgs.bash}/bin/bash
cd $out/share/landing
exec ${pkgs.nodejs_22}/bin/node --jitless apps/landing/server.js "\$@"
EOF
chmod +x $out/bin/imphnen-landing
runHook postInstall
'';
dontNpmBuild = true;
}