Alisa/nix/web.nix
2024-07-11 18:38:07 +02:00

51 lines
717 B
Nix

{
stdenv,
lib,
pnpm,
nodejs,
withBackendUrl ? "",
}:
stdenv.mkDerivation (finalAttrs: {
pname = "web";
version = "0.1";
src = ../web;
pnpmDeps = pnpm.fetchDeps {
inherit (finalAttrs) pname version src;
hash = "sha256-sDeAAvBsYnZchMBCKFN3XODC65Y5mThLwO3//UqcDgI=";
};
nativeBuildInputs = [
nodejs
pnpm.configHook
];
env.VITE_BACKEND_URL = withBackendUrl;
buildPhase = ''
runHook preBuild
pnpm buildNoCheck
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r dist/* $out
runHook postInstall
'';
buildInputs = [ ];
dontStrip = true;
meta = with lib; {
platforms = lib.platforms.all;
};
})