change(nix): simpler dev setup

This commit is contained in:
ethernet 2026-06-23 19:55:26 -04:00
parent 8ae793d3de
commit 447f9e7c89
3 changed files with 18 additions and 29 deletions

2
.envrc
View file

@ -1,5 +1,5 @@
watch_file pyproject.toml uv.lock
watch_file package-lock.json package.json web/package.json ui-tui/package.json website/package.json apps/shared/package.json apps/desktop/package.json ui-tui/packages/hermes-ink/package.json
watch_file flake.nix flake.lock nix/devShell.nix nix/tui.nix nix/package.nix nix/python.nix
watch_file flake.nix flake.lock nix/devShell.nix nix/tui.nix nix/package.nix nix/python.nix nix/hermes-agent.nix nix/desktop.nix
use flake

View file

@ -25,10 +25,12 @@
in
{
devShells.default = pkgs.mkShell {
inputsFrom = packages;
packages = with pkgs; [
uv
];
packages =
with pkgs;
[
uv
]
++ self'.packages.default.passthru.devDeps;
shellHook = ''
echo "Hermes Agent dev shell"
${combinedNonNpm}

View file

@ -37,10 +37,14 @@
}:
let
nodejs = nodejs_22;
hermesVenv = callPackage ./python.nix {
inherit uv2nix pyproject-nix pyproject-build-systems;
dependency-groups = [ "all" ] ++ extraDependencyGroups;
};
mkHermesVenv =
extraDependencyGroups:
callPackage ./python.nix {
inherit uv2nix pyproject-nix pyproject-build-systems;
dependency-groups = [ "all" ] ++ extraDependencyGroups;
};
hermesVenv = mkHermesVenv extraDependencyGroups;
hermesNpmLib = callPackage ./lib.nix {
inherit npm-lockfile-fix nodejs;
@ -106,12 +110,6 @@ let
pythonPath = lib.makeSearchPath sitePackagesPath allExtraPythonPackages;
pyprojectHash = builtins.hashString "sha256" (builtins.readFile ../pyproject.toml);
uvLockHash =
if builtins.pathExists ../uv.lock then
builtins.hashString "sha256" (builtins.readFile ../uv.lock)
else
"none";
checkPackageCollisions = ''
import pathlib, sys, re
@ -223,21 +221,10 @@ stdenv.mkDerivation (finalAttrs: {
};
devShellHook = ''
STAMP=".nix-stamps/hermes-agent"
STAMP_VALUE="${pyprojectHash}:${uvLockHash}"
if [ ! -f "$STAMP" ] || [ "$(cat "$STAMP")" != "$STAMP_VALUE" ]; then
echo "hermes-agent: installing Python dependencies..."
uv venv .venv --python ${python312}/bin/python3 2>/dev/null || true
source .venv/bin/activate
uv pip install -e ".[all]"
[ -d mini-swe-agent ] && uv pip install -e ./mini-swe-agent 2>/dev/null || true
mkdir -p .nix-stamps
echo "$STAMP_VALUE" > "$STAMP"
else
source .venv/bin/activate
export HERMES_PYTHON=${hermesVenv}/bin/python3
fi
export HERMES_PYTHON=${hermesVenv}/bin/python3
'';
devDeps = runtimeDeps ++ [ (mkHermesVenv (extraDependencyGroups ++ [ "dev" ])) ];
};
meta = with lib; {