nix-installer icon indicating copy to clipboard operation
nix-installer copied to clipboard

Mac Remote Builder Path Fix

Open Hoverbear opened this issue 2 years ago • 3 comments

A potential fix for:

https://github.com/DeterminateSystems/nix-installer#using-macos-remote-ssh-builders-nix-binaries-are-not-on-path

Maybe we need to make a symlink in /usr/bin or /usr/local/bin? (Suggested by @mkenigs)

Hoverbear avatar Mar 29 '23 14:03 Hoverbear

I believe on Linux it should be /usr/bin and on macOS /usr/local/bin because /usr/bin isn't writeable

mkenigs avatar Mar 29 '23 15:03 mkenigs

I thought this would work but...

❯ nix store ping --store "ssh://ephemeraladmin@epic-turducken"
Store URL: ssh://ephemeraladmin@epic-turducken
Enter passphrase for key '/home/ana/.ssh/id_rsa': 
zsh:1: command not found: nix-store
error: cannot connect to 'ephemeraladmin@epic-turducken'

ephemeraladmin@mac-epic-turducken ~ % ls -lah /usr/local/bin/nix-store 
lrwxr-xr-x  1 root  wheel    43B Jun 26 12:18 /usr/local/bin/nix-store -> /nix/var/nix/profiles/default/bin/nix-store

It doesn't seem to solve the issue...

Hoverbear avatar Jun 26 '23 19:06 Hoverbear

This was fixed for users using Zsh as their default shell in #714 however as root uses /bin/sh, this is still an issue.

@grahamc I've recently made a PR to fix this in nix-darwin at https://github.com/nix-darwin/nix-darwin/pull/1440 and I think it would be great if this project did same by creating a file /etc/ssh/sshd_config.d/50-nix-path-fallback.conf that contains SetEnv PATH=/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Enzime avatar May 11 '25 07:05 Enzime