I’m not sure if this is a bug or if I have configured something incorrectly.

$ which ls

(returns nothing)

$ which cp
/var/run/current-system/sw/bin/cp

$ ls -l /var/run/current-system/sw/bin/ls
lrwxrwxrwx 1 root nixbld 64 Nov 22 22:26 /var/run/current-system/sw/bin/ls -> /nix/store/sa2w035ha33hkkiw10928sbjgpg0dkx1-coreutils-8.4/bin/ls

$ ls -l /var/run/current-system/sw/bin/cp
lrwxrwxrwx 1 root nixbld 64 Nov 22 22:26 /var/run/current-system/sw/bin/cp -> /nix/store/sa2w035ha33hkkiw10928sbjgpg0dkx1-coreutils-8.4/bin/cp

$ echo $PATH
/root/bin:/var/setuid-wrappers:/root/.nix-profile/bin:/root/.nix-profile/sbin:/root/.nix-profile/lib/kde4/libexec:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/nix/var/nix/profiles/default/lib/kde4/libexec:/var/run/current-system/sw/bin:/var/run/current-system/sw/sbin:/var/run/current-system/sw/lib/kde4/libexec

The end effect of this is that I cannot use tramp mode in emacs to work as the root user because it can’t find ls.

Submitted by Cillian de Róiste on 26 November 2010 at 01:49

On 26 November 2010 at 10:57 Cillian de Róiste commented:

Thanks to viric on irc …
both ls and which have aliases:
$ alias
alias l=‘ls -alh’
alias ll=‘ls -l’
alias which=‘type -p’

so installing the which package also doesn’t help here.

changing the alias type -P means that the which alias works, but emacs tramp is still not happy, will investigate further


On 27 November 2010 at 00:47 Cillian de Róiste commented:

The alias has already been fixed.

To configure emacs so that it finds ls and id (and possibly more) you can add the following to your ~/.emacs

(require ’tramp)
(add-to-list ’tramp-remote-path “/var/run/current-system/sw/bin”)


On 13 December 2010 at 01:22 Cillian de Róiste tagged solved

On 13 December 2010 at 01:22 Cillian de Róiste closed this issue.

Log in to post comments