diff --git a/nix/packages/frontend.nix b/nix/packages/frontend.nix new file mode 100644 index 0000000..8ed9d35 --- /dev/null +++ b/nix/packages/frontend.nix @@ -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; + }; +})