Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Packages in home.packages are not available to run noninteractively via SSH on standalone home-manager on macOS #5336

Open
2 tasks done
Samasaur1 opened this issue Apr 24, 2024 · 0 comments
Assignees
Labels
bug triage Issues or feature request that have not been triaged yet

Comments

@Samasaur1
Copy link

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

Anything in home.packages is not available to run noninteractively via SSH. For example, with this home-manager config:

home.packages = [ pkgs.hello ];

I see the following behavior:

[sam] $ ssh server
[sam@server] $ hello
Hello, world!
[sam@server] $ exit
[sam] $ ssh server hello
bash: line 1: hello: command not found

I should be able to run ssh server hello and successfully see "Hello, world!"

This is only the case using standalone home-manager on macOS, not in any of the following cases:

  • home-manager as a nix-darwin module
  • home-manager standalone on NixOS
  • home-manager as a NixOS module

In all three of these other cases, ssh server hello works correctly.

The issue is that packages in home.packages aren't added to my PATH for noninteractive shells. This is because everything in home.packages is added to PATH in /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh which is sourced in /etc/bashrc which had nothing to do with home-manager. So it seems like home-manager has been relying on some behavior from nixos and nix-darwin (I actually can't track down where home.packages gets added to my PATH when using home-manager as a nix-darwin module).

Maintainer CC

No response

System information

- system: `"x86_64-darwin"`
 - host os: `Darwin 21.6.0, macOS 10.16`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.20.5`
 - nixpkgs: `/nix/store/0vyi8f8l8cya10dmgfrj0df2iqxlhiyi-source`
@Samasaur1 Samasaur1 added bug triage Issues or feature request that have not been triaged yet labels Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Issues or feature request that have not been triaged yet
Projects
None yet
Development

No branches or pull requests

4 participants