On a Nix package every `hermes plugins enable|disable`, plugin install,
plugin update and `hermes pm install` died in the venv stamp: PM looked
for uv.lock beside the wheel-installed modules (#140765). Shipping the
lockfile does not help, because the sync then builds a dependency
generation from a source tree the package does not carry.
A Nix package's environment is its store closure, so the sync no longer
builds there. On a `distribution: nix` install it checks what a plugin
change brings in, and what extras were asked for, against the
distributions the application can already import, publishes the change
when they are satisfied, and refuses by package name otherwise, pointing
at extraPythonPackages and extraDependencyGroups. The sync records no
dependency state and downloads nothing.
- pm/nix_admission.py: the check. The application's sys.path reaches
every PM child through runtime_environment(), so the worker and
`hermes pm ...` judge the same environment.
- A plugin that was already enabled is not re-judged by an unrelated
change, so one enabled by hand cannot block enabling or disabling
another, or itself.
- `hermes pm install` without --extra no longer asks a Nix package for
[all]: the package variant chose its extras.
- Only the executing tree resolves through the package's stamp; a Nix
install asked to sync another checkout reads that checkout's.
Fixes#140765
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>