[Nix-dev] getconf PATH

Jonas Hörsch coroa at online.de
Sun Jun 2 13:03:30 CEST 2013


hej,

i've just been debugging emacs remote editing per ssh onto a nixos
machine, and found that emacs fails to find the correct path on the
remote machine and then errors out on missing the ls command.

for determining the correct value of PATH it invokes getconf PATH. on
nixos and archlinux this returns /bin:/usr/bin. while this value is good
enough for archlinux, it doesn't work for nixos, where practically no
command resides there.

the man page of getconf is not available on my nix machine but can
be found at [1]. it claims:

[...]

The original need for this utility, and for the confstr() function, was
to provide a way of finding the configuration-defined default value for
the PATH environment variable. Since PATH can be modified by the user to
include directories that could contain utilities replacing the standard
utilities, shell scripts need a way to determine the system-supplied
PATH environment variable value that contains the correct search path
for the standard utilities. It was later suggested that access to the
other variables described in this volume of IEEE Std 1003.1-2001 could
also be useful to applications.

[...]

it sounds to me as if this should at least include
/run/current-system/sw/bin on nixos machines. i couldn't find out how to
configure it, but perhaps somebody else does? (the confstr manpage might
help [2]).

ok and then there is probably the stance, that emacs is broken in this
regard and should rather use the actual environment variables, than
summoning this getconf tool. i'm not sure about this myself. comments?

thanks,
jonas

Footnotes:

[1] http://linux.die.net/man/1/getconf

[2] http://linux.die.net/man/3/confstr



More information about the nix-dev mailing list