Generate frontend icons from the shared source artwork during each build. Keep the locked icon dependencies out of the application runtime. Nix needs setuptools and CFFI to build the locked python-olm source. Its offline npm manifest must omit semver overrides because direct package specs become local tarball paths. Preserve the repository manifest and lockfile. Docker must use the PM interpreter rather than a second Python under /root. Install the application into its venv explicitly, use the image compiler, and make package facts readable by the runtime user. Verified: - nix build .#desktop and frontend-icons/package-contents/cli-commands - Packaged Electron PTY spawn and libolm encryption roundtrip - ARM Linux and macOS desktop evaluation, not native builds - Docker linux/amd64 build and 8 focused runtime tests The full test suite was not run. Leave llama integration unchanged.
35 lines
1.0 KiB
Nix
35 lines
1.0 KiB
Nix
# nix/web.nix — Hermes Web Dashboard (Vite/React) frontend build
|
|
{ hermesNpmLib, generatedIcons, ... }:
|
|
hermesNpmLib.buildNpmPackage {
|
|
dirs = [
|
|
"web"
|
|
|
|
# @hermes/shared ships as a file: workspace dep of web, so its source
|
|
# must be in the filtered src tree too.
|
|
"apps/shared"
|
|
];
|
|
|
|
doCheck = false;
|
|
|
|
buildPhase = ''
|
|
cp -r ${generatedIcons}/web/public/. web/public/
|
|
# Build from web/ so vite.config.ts and tsconfig resolve correctly.
|
|
# The workspace root's node_modules/ is at ../node_modules/.
|
|
cd web
|
|
node ../node_modules/typescript/bin/tsc -b
|
|
# outDir in vite.config.ts points to ../hermes_cli/web_dist for the
|
|
# monorepo layout. Override with --outDir dist for the nix build.
|
|
node ../node_modules/vite/bin/vite.js build --outDir dist
|
|
|
|
# Return to source root so installPhase paths are correct.
|
|
cd ..
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
# vite writes to web/dist/ (we cd'd there, overrode outDir, then cd'd back).
|
|
cp -r web/dist $out
|
|
runHook postInstall
|
|
'';
|
|
}
|