fix(nix): make extraPackages actually work via per-user profile - #17047
Merged
Conversation
#17030 deprecated extraPackages because it only set the systemd service PATH, which the terminal backend's login-shell snapshot discards. Instead of deprecating, fix it: set users.users.${cfg.user}.packages so NixOS builds a per-user profile at /etc/profiles/per-user/hermes/bin. This path is included in PATH by /etc/set-environment, which the login shell sources, so the terminal backend's snapshot picks it up. One line of actual logic: users.users.${cfg.user}.packages = cfg.extraPackages; Verified in a NixOS VM test: su - hermes -c 'which hello' resolves to /etc/profiles/per-user/hermes/bin/hello. Reverts the deprecation warning and docs changes from #17030, restores extraPackages as the recommended way to give the agent extra tools. Container mode is unaffected — extraPackages was always native-only (the systemd path line is inside !cfg.container.enable).
|
❤️ this looks good, my only concern is making sure we're augmenting, not replacing the existing package list |
alt-glitch
marked this pull request as ready for review
April 28, 2026 18:20
donald131
pushed a commit
to donald131/hermes-agent
that referenced
this pull request
May 2, 2026
…Research#17047) * fix(nix): make extraPackages actually work — wire into per-user profile NousResearch#17030 deprecated extraPackages because it only set the systemd service PATH, which the terminal backend's login-shell snapshot discards. Instead of deprecating, fix it: set users.users.${cfg.user}.packages so NixOS builds a per-user profile at /etc/profiles/per-user/hermes/bin. This path is included in PATH by /etc/set-environment, which the login shell sources, so the terminal backend's snapshot picks it up. One line of actual logic: users.users.${cfg.user}.packages = cfg.extraPackages; Verified in a NixOS VM test: su - hermes -c 'which hello' resolves to /etc/profiles/per-user/hermes/bin/hello. Reverts the deprecation warning and docs changes from NousResearch#17030, restores extraPackages as the recommended way to give the agent extra tools. Container mode is unaffected — extraPackages was always native-only (the systemd path line is inside !cfg.container.enable). * nix: clarify additive merge semantics for extraPackages user profile --------- Co-authored-by: Siddharth Balyan <daimon@noreply.github.com>
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…Research#17047) * fix(nix): make extraPackages actually work — wire into per-user profile NousResearch#17030 deprecated extraPackages because it only set the systemd service PATH, which the terminal backend's login-shell snapshot discards. Instead of deprecating, fix it: set users.users.${cfg.user}.packages so NixOS builds a per-user profile at /etc/profiles/per-user/hermes/bin. This path is included in PATH by /etc/set-environment, which the login shell sources, so the terminal backend's snapshot picks it up. One line of actual logic: users.users.${cfg.user}.packages = cfg.extraPackages; Verified in a NixOS VM test: su - hermes -c 'which hello' resolves to /etc/profiles/per-user/hermes/bin/hello. Reverts the deprecation warning and docs changes from NousResearch#17030, restores extraPackages as the recommended way to give the agent extra tools. Container mode is unaffected — extraPackages was always native-only (the systemd path line is inside !cfg.container.enable). * nix: clarify additive merge semantics for extraPackages user profile --------- Co-authored-by: Siddharth Balyan <daimon@noreply.github.com>
dannyJ848
pushed a commit
to dannyJ848/hermes-agent
that referenced
this pull request
May 17, 2026
…Research#17047) * fix(nix): make extraPackages actually work — wire into per-user profile NousResearch#17030 deprecated extraPackages because it only set the systemd service PATH, which the terminal backend's login-shell snapshot discards. Instead of deprecating, fix it: set users.users.${cfg.user}.packages so NixOS builds a per-user profile at /etc/profiles/per-user/hermes/bin. This path is included in PATH by /etc/set-environment, which the login shell sources, so the terminal backend's snapshot picks it up. One line of actual logic: users.users.${cfg.user}.packages = cfg.extraPackages; Verified in a NixOS VM test: su - hermes -c 'which hello' resolves to /etc/profiles/per-user/hermes/bin/hello. Reverts the deprecation warning and docs changes from NousResearch#17030, restores extraPackages as the recommended way to give the agent extra tools. Container mode is unaffected — extraPackages was always native-only (the systemd path line is inside !cfg.container.enable). * nix: clarify additive merge semantics for extraPackages user profile --------- Co-authored-by: Siddharth Balyan <daimon@noreply.github.com>
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…Research#17047) * fix(nix): make extraPackages actually work — wire into per-user profile NousResearch#17030 deprecated extraPackages because it only set the systemd service PATH, which the terminal backend's login-shell snapshot discards. Instead of deprecating, fix it: set users.users.${cfg.user}.packages so NixOS builds a per-user profile at /etc/profiles/per-user/hermes/bin. This path is included in PATH by /etc/set-environment, which the login shell sources, so the terminal backend's snapshot picks it up. One line of actual logic: users.users.${cfg.user}.packages = cfg.extraPackages; Verified in a NixOS VM test: su - hermes -c 'which hello' resolves to /etc/profiles/per-user/hermes/bin/hello. Reverts the deprecation warning and docs changes from NousResearch#17030, restores extraPackages as the recommended way to give the agent extra tools. Container mode is unaffected — extraPackages was always native-only (the systemd path line is inside !cfg.container.enable). * nix: clarify additive merge semantics for extraPackages user profile --------- Co-authored-by: Siddharth Balyan <daimon@noreply.github.com>
Seven74AI
pushed a commit
to Seven74AI/hermes-agent
that referenced
this pull request
Jun 13, 2026
…Research#17047) * fix(nix): make extraPackages actually work — wire into per-user profile NousResearch#17030 deprecated extraPackages because it only set the systemd service PATH, which the terminal backend's login-shell snapshot discards. Instead of deprecating, fix it: set users.users.${cfg.user}.packages so NixOS builds a per-user profile at /etc/profiles/per-user/hermes/bin. This path is included in PATH by /etc/set-environment, which the login shell sources, so the terminal backend's snapshot picks it up. One line of actual logic: users.users.${cfg.user}.packages = cfg.extraPackages; Verified in a NixOS VM test: su - hermes -c 'which hello' resolves to /etc/profiles/per-user/hermes/bin/hello. Reverts the deprecation warning and docs changes from NousResearch#17030, restores extraPackages as the recommended way to give the agent extra tools. Container mode is unaffected — extraPackages was always native-only (the systemd path line is inside !cfg.container.enable). * nix: clarify additive merge semantics for extraPackages user profile --------- Co-authored-by: Siddharth Balyan <daimon@noreply.github.com>
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…Research#17047) * fix(nix): make extraPackages actually work — wire into per-user profile NousResearch#17030 deprecated extraPackages because it only set the systemd service PATH, which the terminal backend's login-shell snapshot discards. Instead of deprecating, fix it: set users.users.${cfg.user}.packages so NixOS builds a per-user profile at /etc/profiles/per-user/hermes/bin. This path is included in PATH by /etc/set-environment, which the login shell sources, so the terminal backend's snapshot picks it up. One line of actual logic: users.users.${cfg.user}.packages = cfg.extraPackages; Verified in a NixOS VM test: su - hermes -c 'which hello' resolves to /etc/profiles/per-user/hermes/bin/hello. Reverts the deprecation warning and docs changes from NousResearch#17030, restores extraPackages as the recommended way to give the agent extra tools. Container mode is unaffected — extraPackages was always native-only (the systemd path line is inside !cfg.container.enable). * nix: clarify additive merge semantics for extraPackages user profile --------- Co-authored-by: Siddharth Balyan <daimon@noreply.github.com>
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…Research#17047) * fix(nix): make extraPackages actually work — wire into per-user profile NousResearch#17030 deprecated extraPackages because it only set the systemd service PATH, which the terminal backend's login-shell snapshot discards. Instead of deprecating, fix it: set users.users.${cfg.user}.packages so NixOS builds a per-user profile at /etc/profiles/per-user/hermes/bin. This path is included in PATH by /etc/set-environment, which the login shell sources, so the terminal backend's snapshot picks it up. One line of actual logic: users.users.${cfg.user}.packages = cfg.extraPackages; Verified in a NixOS VM test: su - hermes -c 'which hello' resolves to /etc/profiles/per-user/hermes/bin/hello. Reverts the deprecation warning and docs changes from NousResearch#17030, restores extraPackages as the recommended way to give the agent extra tools. Container mode is unaffected — extraPackages was always native-only (the systemd path line is inside !cfg.container.enable). * nix: clarify additive merge semantics for extraPackages user profile --------- Co-authored-by: Siddharth Balyan <daimon@noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
#17030 deprecated
extraPackagesbecause packages added to the systemd service PATH weren't visible to terminal commands, skills, or cron jobs — the terminal backend's login-shell snapshot rebuilds PATH from NixOS system profiles, discarding the service PATH.The deprecation told users to switch to
environment.systemPackages, which works but is a sledgehammer — it pollutes every user's shell on the system. If you only need pandoc for the hermes agent, you shouldn't have to put it in the global profile.The fix
Instead of deprecating, make
extraPackagesactually work. One line of logic:This tells NixOS "the hermes user has these packages," which creates a per-user profile at
/etc/profiles/per-user/hermes/bin. That path is already in the PATH that/etc/set-environmentconstructs:The login-shell snapshot (
bash -l -c 'export -p') picks this up, so terminal commands, skills, and cron jobs all see the packages. The systemdpathline still includes them too for direct process access.Why this works for system users
NixOS creates per-user profiles for any user with
packages != []— there's noisNormalUserfilter. Fromnixos/modules/config/users-groups.nix:Verification
Tested in a NixOS VM (
nixos/librunTest):Edge cases
createUser = false:users.users.<name>.packagesis additive — doesn't require the module to own the user definition. Works fine.extraPackageswas always native-only (the systemdpathline is inside!cfg.container.enable). The per-user profile lives on the host, not inside the container. No regression.Changes
nix/nixosModules.nixwebsite/docs/getting-started/nix-setup.mdextraPackages(was changed toenvironment.systemPackagesin fix(nix): deprecate extraPackages — does not reach terminal/skills #17030)extraPackagesfor system binaries