feat(hermes): pre-bundle google-api-python-client into hermes python3 #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "agent/python-tooling"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Add a new
modules/hermes-tooling.nixthat exposes a single option,hermes.tooling.python, resolving to apython3derivation withgoogle-api-python-client,google-auth-oauthlib, andrequestsalready on
PYTHONPATH. Switchservices.hermes-agent.extraPackageson
serverto use this new derivation in place of the barepython3.Why
The hermes agent runs ad-hoc Python scripts for Google Calendar / Drive
/ etc. via the
google-api-python-clientlibrary. The current setuponly ships
python3inextraPackages, so every script that needsthose libs has to be wrapped in:
This pulls a ~157 MiB closure on every cold invocation (and the first
build can take 30-60s while packages are fetched from the binary
cache). Pre-bundling the libs in the system profile makes
python3 script.pyJust Work and removes the wrapper from skillrecipes.
The module is shared (
modules/) rather than hard-coded indevices/server/configuration.nixso any future device that runs thehermes agent can opt in the same way.
Diffstat
Verification
After
nixos-rebuild switch --flake .#server:Caveats
libs and their transitive deps). Negligible vs. the build that
nix-shellwas already doing on demand.withPackageslist inmodules/hermes-tooling.nix. The python3 derivation is content-addressed so only the affected layer of the closure rebuilds.
nix evalend-to-end on this host because theprixdugazflake input can't be re-fetched from github (SSH authdenied). The module parses and
nix-instantiate --evalon itsucceeds in isolation — but a real
nixos-rebuild switchonserveris the definitive test.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.