Alisa/nix/web.nix

52 lines
717 B
Nix
Raw Normal View History

2024-07-05 13:55:44 +02:00
{
stdenv,
lib,
pnpm,
2024-07-11 14:10:10 +02:00
nodejs,
2024-07-11 18:38:07 +02:00
withBackendUrl ? "",
2024-07-05 13:55:44 +02:00
}:
stdenv.mkDerivation (finalAttrs: {
pname = "web";
version = "0.1";
src = ../web;
pnpmDeps = pnpm.fetchDeps {
inherit (finalAttrs) pname version src;
2024-07-11 14:10:10 +02:00
hash = "sha256-sDeAAvBsYnZchMBCKFN3XODC65Y5mThLwO3//UqcDgI=";
2024-07-05 13:55:44 +02:00
};
2024-07-11 14:10:10 +02:00
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
'';
2024-07-05 13:55:44 +02:00
2024-07-10 16:03:10 +02:00
buildInputs = [ ];
2024-07-05 13:55:44 +02:00
dontStrip = true;
meta = with lib; {
platforms = lib.platforms.all;
};
})