feat: add Nix flake for reproducible builds and deployment
- Add flake.nix with packages for all 5 apps (landing, gacha, backoffice, dimentorin, hackathon) - Add NixOS modules for deployment (systemd service for Next.js, nginx for Vite apps) - Add mkHackathonWithEnv function for build-time environment variables - Add development shell with Node.js 22, npm, bun 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
f77967a092
commit
5be9ec1edf
@@ -0,0 +1,33 @@
|
||||
# Helper function to build Vite-based static apps
|
||||
{ pkgs, src, npmDepsHash }:
|
||||
|
||||
{ name, buildScript, envVars ? {} }:
|
||||
|
||||
pkgs.buildNpmPackage {
|
||||
pname = "imphnen-${name}";
|
||||
version = "0.0.1";
|
||||
inherit src npmDepsHash;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
nodejs_22
|
||||
nodePackages.npm
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
export NX_DAEMON=false
|
||||
export HOME=$TMPDIR
|
||||
${pkgs.lib.concatStringsSep "\n" (pkgs.lib.mapAttrsToList (k: v: "export ${k}=\"${v}\"") envVars)}
|
||||
npm run ${buildScript}
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out
|
||||
cp -r dist/apps/${name}/* $out/
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
dontNpmBuild = true;
|
||||
}
|
||||
Reference in New Issue
Block a user