Fix Nix build — compute npmDepsHash and get flake building #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Get
nix buildworking for the spatial-office flake. Currently:flake.nixhasnpmDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="(placeholder)packages/frontend/package.jsondepends on react, @react-three/fiber, @react-three/drei, three, zustand, gsappackages/backend/package.jsondepends on ws, zod, tsx, typescriptSteps
pnpm-lock.yaml/package-lock.jsonfiles for both packages (use pnpm sincepnpm-workspace.yamlexists)nix run nixpkgs#prefetch-npm-deps/nix build --impuretrick)flake.nixwith real hashesnix buildsucceeds end-to-endTechnical Notes
pnpm-workspace.yaml)buildNpmPackagein nixpkgs works with pnpm ifpnpmConfigHookis used, or switch tonpmfor simplicitycorepack pnpm run build— needs pnpm + proper lockfilecorepack pnpm run buildDependencies
Deliverable
Updated flake.nix with correct npmDepsHash values + confirmation that
nix build .#frontend,nix build .#backend, andnix buildall succeed.✅ All three Nix builds pass now:
nix build .#frontend— React/Three.js frontend built with Vite, outputsassets/+index.htmlnix build .#backend— WebSocket server with ws+zod, outputsbin/spatial-office-backendnix build(default) — combined symlink forest of bothWhat changed:
src/frontend/intopackages/frontend/src/(the real React/Three.js code: App, OfficeScene, AgentSprite, store, WebSocketClient)packages/backend/src/index.ts— real WebSocket server with agent state managementbuildNpmPackageuses npm lockfiles, so buildPhase now usesnpm run buildinstead ofcorepack pnpm run buildsha256-yZajnZGRNnZo+zm8b0N9+nNOoyxt2EOoxwWYINl6FZU=sha256-GB3oOOAD7RJwkUR21zA9R66b5MlLXMU0IwOOgflfE14=packages/frontend/index.htmland vite.config.js (previously only insrc/frontend/)Two commits on master:
03eaea3(source files) andd1cc325(flake hash updates).