package vue frontend with nix

This commit is contained in:
Yisroel Baum 2026-05-08 10:50:11 +03:00
parent d7f7460601
commit b7db23b6aa

33
nix/packages/frontend.nix Normal file
View file

@ -0,0 +1,33 @@
{ buildNpmPackage, lib, nodejs_22, apiUrl }:
buildNpmPackage (finalAttrs: {
pname = "tide-frontend";
version = "0.0.0";
src = lib.cleanSource ../../frontend/blog_portal;
nodejs = nodejs_22;
npmDepsFetcherVersion = 2;
npmDepsHash = "sha256-NHAo9Bvg80W2341yPaw97khUCJyr/7fyQFvhQFKWYnY=";
env = {
VITE_API_URL = apiUrl;
# Cypress' postinstall reaches out to download.cypress.io, which
# is not allowed inside the Nix sandbox. Cypress is only used
# for local E2E so skip the download during the production
# build.
CYPRESS_INSTALL_BINARY = "0";
};
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r dist/* $out/
runHook postInstall
'';
meta = {
description = "TIDE Vue frontend (blog_portal)";
license = lib.licenses.mit;
};
})