mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-25 05:52:34 +00:00
feat(nix): add extraDependencyGroups for sealed venv extras (#21817)
Expose the dependency-groups parameter from python.nix through
hermes-agent.nix and the NixOS module, allowing users to opt into
pyproject.toml optional extras (e.g. hindsight, voice, matrix) that
are resolved by uv inside the sealed venv.
Unlike extraPythonPackages (which appends to PYTHONPATH and requires
collision checking), extraDependencyGroups resolves the full dependency
graph in a single uv pass — no PYTHONPATH patching, no version
conflicts, no collision risk.
When to use which:
- extraDependencyGroups: enable a pyproject.toml optional extra
- extraPythonPackages: add an external Python plugin not in pyproject.toml
Usage:
services.hermes-agent.extraDependencyGroups = [ "hindsight" ];
Or via overlay:
pkgs.hermes-agent.override { extraDependencyGroups = [ "hindsight" ]; }
Refs: #8873, #9194
This commit is contained in:
parent
d992fd9aaf
commit
5606258855
4 changed files with 71 additions and 4 deletions
|
|
@ -28,8 +28,10 @@
|
|||
|
||||
let
|
||||
cfg = config.services.hermes-agent;
|
||||
effectivePackage = if cfg.extraPythonPackages == [ ] then cfg.package
|
||||
else cfg.package.override { inherit (cfg) extraPythonPackages; };
|
||||
effectivePackage =
|
||||
if cfg.extraPythonPackages == [ ] && cfg.extraDependencyGroups == [ ]
|
||||
then cfg.package
|
||||
else cfg.package.override { inherit (cfg) extraPythonPackages extraDependencyGroups; };
|
||||
hermes-agent = inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||
|
||||
# Deep-merge config type (from 0xrsydn/nix-hermes-agent)
|
||||
|
|
@ -512,6 +514,21 @@
|
|||
'';
|
||||
};
|
||||
|
||||
extraDependencyGroups = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Additional pyproject.toml optional-dependency groups to include in
|
||||
the sealed Python venv. These are resolved by uv alongside core
|
||||
dependencies — no PYTHONPATH patching or collision risk.
|
||||
|
||||
Use this for optional extras already declared in hermes-agent's
|
||||
pyproject.toml (e.g. "hindsight", "honcho", "voice").
|
||||
Use extraPythonPackages for external packages not in pyproject.toml.
|
||||
'';
|
||||
example = [ "hindsight" ];
|
||||
};
|
||||
|
||||
restart = mkOption {
|
||||
type = types.str;
|
||||
default = "always";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue