Summary
The Nix flake package (nix/packages.nix) has two bugs that completely break hermes dashboard:
-
fastapi missing from the virtualenv — uv2nix resolves hermes-agent[all] (which includes [web]), but fastapi is silently dropped from the final venv. Its dependencies (starlette, uvicorn, pydantic) are present, but fastapi itself is not. Running hermes dashboard fails immediately:
SystemExit: Web UI requires fastapi and uvicorn.
Run 'hermes web' to auto-install, or: pip install hermes-agent[web]
-
web_dist/ not built or bundled — pyproject.toml declares hermes_cli = ["web_dist/**/*"] as package data, but the source tree doesn't contain hermes_cli/web_dist/ (it requires cd web && npm run build to generate). The Nix package (nix/packages.nix) doesn't run this build step, so even after fixing the fastapi import, the dashboard returns:
{"error":"Frontend not built. Run: cd web && npm run build"}
Environment
- hermes-agent v0.9.0 (commit 78fa758)
- NixOS unstable (nixpkgs rev 4c1018d)
- Python 3.11.15 (from uv2nix venv)
Workaround
We're working around both issues in our NixOS config:
fastapi: Fetch the wheel directly and inject via PYTHONPATH:
fastapi-wheel = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/.../fastapi-0.133.1-py3-none-any.whl";
hash = "sha256-ZY80ujNGBbFhemWt8upkYZAb25rzowgNY/95Hs99wuI=";
};
fastapi-pkg = pkgs.runCommand "fastapi-0.133.1" {} ''
mkdir -p $out/lib/python3.11/site-packages
${pkgs.unzip}/bin/unzip ${fastapi-wheel} -d $out/lib/python3.11/site-packages
'';
web_dist: Build the frontend with buildNpmPackage and inject into a PYTHONPATH overlay that shadows hermes_cli:
hermes-web-dist = pkgs.buildNpmPackage {
pname = "hermes-web-dist";
version = "0.9.0";
src = "${hermesSrc}/web";
npmDepsHash = "sha256-kBq8QpUBmvfinqjGXT81TatWslql/uZN6Fd7b/We4VI=";
buildPhase = ''npm run build -- --outDir $out'';
dontInstall = true;
};
Then we create an overlay derivation that copies hermes_cli from the venv and symlinks web_dist + fastapi into it, and prepend it via --prefix PYTHONPATH on the hermes wrapper.
Suggested fix
-
fastapi: Debug why uv2nix drops fastapi from the [all] extra resolution in nix/python.nix. May need an explicit override similar to the existing aarch64-darwin overrides.
-
web_dist: Add a buildNpmPackage step to nix/packages.nix that runs cd web && npm run build and copies the output into hermes_cli/web_dist/ in the final package. The vite.config.ts already has outDir: "../hermes_cli/web_dist" configured.
🤖 Generated with Claude Code
Summary
The Nix flake package (
nix/packages.nix) has two bugs that completely breakhermes dashboard:fastapimissing from the virtualenv — uv2nix resolveshermes-agent[all](which includes[web]), butfastapiis silently dropped from the final venv. Its dependencies (starlette,uvicorn,pydantic) are present, butfastapiitself is not. Runninghermes dashboardfails immediately:web_dist/not built or bundled —pyproject.tomldeclareshermes_cli = ["web_dist/**/*"]as package data, but the source tree doesn't containhermes_cli/web_dist/(it requirescd web && npm run buildto generate). The Nix package (nix/packages.nix) doesn't run this build step, so even after fixing the fastapi import, the dashboard returns:{"error":"Frontend not built. Run: cd web && npm run build"}Environment
Workaround
We're working around both issues in our NixOS config:
fastapi: Fetch the wheel directly and inject via PYTHONPATH:
web_dist: Build the frontend with
buildNpmPackageand inject into a PYTHONPATH overlay that shadowshermes_cli:Then we create an overlay derivation that copies
hermes_clifrom the venv and symlinksweb_dist+fastapiinto it, and prepend it via--prefix PYTHONPATHon the hermes wrapper.Suggested fix
fastapi: Debug why uv2nix drops
fastapifrom the[all]extra resolution innix/python.nix. May need an explicit override similar to the existingaarch64-darwinoverrides.web_dist: Add a
buildNpmPackagestep tonix/packages.nixthat runscd web && npm run buildand copies the output intohermes_cli/web_dist/in the final package. Thevite.config.tsalready hasoutDir: "../hermes_cli/web_dist"configured.🤖 Generated with Claude Code