unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* emacs tramp in remote guix
       [not found] <87h795s97x.fsf.ref@yahoo.com.br>
@ 2022-02-11 15:40 ` Antonio Carlos Padoan Junior
  2022-02-12  2:42   ` Mikhail Kryshen
  0 siblings, 1 reply; 7+ messages in thread
From: Antonio Carlos Padoan Junior @ 2022-02-11 15:40 UTC (permalink / raw)
  To: guix-devel

Hello everybody,

I'm trying to use emacs tramp to connect to a guix machine but tramp
complains it can't find an appropriate 'ls' command.

I tried to help tramp setting the following:
  (add-to-list 'tramp-remote-path "/run/current-system/profile/bin")

But I'm still not lucky. I always get the same error.  Is there any
elegant way to correctly use tramp with a remote guix machine?

For information, my "client" is also a guix machine.

Best regards,
-- 
Antonio Carlos PADOAN JUNIOR
Phone: +33(0)6 5035 1196
GPG fingerprint:
243F 237F 2DD3 4DCA 4EA3  1341 2481 90F9 B421 A6C9


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emacs tramp in remote guix
  2022-02-11 15:40 ` emacs tramp in remote guix Antonio Carlos Padoan Junior
@ 2022-02-12  2:42   ` Mikhail Kryshen
  2022-02-12 11:30     ` Josselin Poiret
  0 siblings, 1 reply; 7+ messages in thread
From: Mikhail Kryshen @ 2022-02-12  2:42 UTC (permalink / raw)
  To: Antonio Carlos Padoan Junior, guix-devel

[-- Attachment #1: Type: text/plain, Size: 625 bytes --]

Hello,

Antonio Carlos Padoan Junior <acpadoanjr@yahoo.com.br> writes:

> Hello everybody,
>
> I'm trying to use emacs tramp to connect to a guix machine but tramp
> complains it can't find an appropriate 'ls' command.
>
> I tried to help tramp setting the following:
>   (add-to-list 'tramp-remote-path "/run/current-system/profile/bin")

For me this works.

> But I'm still not lucky. I always get the same error.  Is there any
> elegant way to correctly use tramp with a remote guix machine?

You may need to delete ~/.emacs.d/tramp before starting Emacs for the
setting to take effect.

-- 
Mikhail

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emacs tramp in remote guix
  2022-02-12  2:42   ` Mikhail Kryshen
@ 2022-02-12 11:30     ` Josselin Poiret
  2022-02-12 18:04       ` Antonio Carlos Padoan Junior
  0 siblings, 1 reply; 7+ messages in thread
From: Josselin Poiret @ 2022-02-12 11:30 UTC (permalink / raw)
  To: Mikhail Kryshen, Antonio Carlos Padoan Junior, guix-devel

Hello everyone,

Mikhail Kryshen <mikhail@kryshen.net> writes:

> Hello,
>
> Antonio Carlos Padoan Junior <acpadoanjr@yahoo.com.br> writes:
>
>> Hello everybody,
>>
>> I'm trying to use emacs tramp to connect to a guix machine but tramp
>> complains it can't find an appropriate 'ls' command.
>>
>> I tried to help tramp setting the following:
>>   (add-to-list 'tramp-remote-path "/run/current-system/profile/bin")
>
> For me this works.
>
>> But I'm still not lucky. I always get the same error.  Is there any
>> elegant way to correctly use tramp with a remote guix machine?
>
> You may need to delete ~/.emacs.d/tramp before starting Emacs for the
> setting to take effect.

I personally use
--8<---------------cut here---------------start------------->8---
  (require 'tramp)
  (connection-local-set-profile-variables
   'guix-system
   '((tramp-remote-path . (tramp-own-remote-path))))
  (connection-local-set-profiles
   '(:application tramp :protocol "sudo" :machine "hostname")
   'guix-system)
--8<---------------cut here---------------end--------------->8---
for tramp on my own machine.  The symbol 'tramp-own-remote-path uses the
login shell of the target to determine the environment to use, so is
well suited for guix.  You may need to adjust the :protocol and :machine
keys of the connection-local-set-profiles call for your use case though.

Best,
-- 
Josselin Poiret


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emacs tramp in remote guix
  2022-02-12 11:30     ` Josselin Poiret
@ 2022-02-12 18:04       ` Antonio Carlos Padoan Junior
  2022-02-12 18:14         ` Maxime Devos
  0 siblings, 1 reply; 7+ messages in thread
From: Antonio Carlos Padoan Junior @ 2022-02-12 18:04 UTC (permalink / raw)
  To: Josselin Poiret; +Cc: Mikhail Kryshen, guix-devel


Josselin Poiret <dev@jpoiret.xyz> writes:

>
> I personally use
>
>   (require 'tramp)
>   (connection-local-set-profile-variables
>    'guix-system
>    '((tramp-remote-path . (tramp-own-remote-path))))
>   (connection-local-set-profiles
>    '(:application tramp :protocol "sudo" :machine "hostname")
>    'guix-system)
>
> for tramp on my own machine.  The symbol 'tramp-own-remote-path uses the
> login shell of the target to determine the environment to use, so is
> well suited for guix.  You may need to adjust the :protocol and :machine
> keys of the connection-local-set-profiles call for your use case though.
>
> Best,

Thanks Josselin and Mikhail!

Cleaning the tramp file did the job! It works now!

I will check closely Josselin proposition as well, it seems I have
something new to learn there.

IMHO, giving the importance emacs has in guix distribution this is
something that merits a place on guix cookbook perhaps.

Best regards
-- 
Antonio Carlos PADOAN JUNIOR
Phone: +33(0)6 5035 1196
GPG fingerprint:
243F 237F 2DD3 4DCA 4EA3  1341 2481 90F9 B421 A6C9


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emacs tramp in remote guix
  2022-02-12 18:04       ` Antonio Carlos Padoan Junior
@ 2022-02-12 18:14         ` Maxime Devos
  2022-02-13  9:52           ` Josselin Poiret
  0 siblings, 1 reply; 7+ messages in thread
From: Maxime Devos @ 2022-02-12 18:14 UTC (permalink / raw)
  To: Antonio Carlos Padoan Junior, Josselin Poiret; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1562 bytes --]

Antonio Carlos Padoan Junior schreef op za 12-02-2022 om 19:04 [+0100]:
> Josselin Poiret <dev@jpoiret.xyz> writes:
> 
> > 
> > I personally use
> > 
> >   (require 'tramp)
> >   (connection-local-set-profile-variables
> >    'guix-system
> >    '((tramp-remote-path . (tramp-own-remote-path))))
> >   (connection-local-set-profiles
> >    '(:application tramp :protocol "sudo" :machine "hostname")
> >    'guix-system)
> > 
> > for tramp on my own machine.  The symbol 'tramp-own-remote-path uses the
> > login shell of the target to determine the environment to use, so is
> > well suited for guix.  You may need to adjust the :protocol and :machine
> > keys of the connection-local-set-profiles call for your use case though.
> > 
> > Best,
> 
> Thanks Josselin and Mikhail!
> 
> Cleaning the tramp file did the job! It works now!
> 
> I will check closely Josselin proposition as well, it seems I have
> something new to learn there.
> 
> IMHO, giving the importance emacs has in guix distribution this is
> something that merits a place on guix cookbook perhaps.

I think that ideally, the tramp package in Guix would be patched to
recognise ~/.guix-profile/etc/profile and /etc/profile (when present,
on the remote machine) and use that to determine the PATH for the
remote machine (or some other system, whatever works) .

Thne tramp would work out-of-the-box, without having to consult a
cookbook or manual and without having to know that this information is
located there.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emacs tramp in remote guix
  2022-02-12 18:14         ` Maxime Devos
@ 2022-02-13  9:52           ` Josselin Poiret
  2022-02-16 10:43             ` Max Brieiev
  0 siblings, 1 reply; 7+ messages in thread
From: Josselin Poiret @ 2022-02-13  9:52 UTC (permalink / raw)
  To: Maxime Devos, Antonio Carlos Padoan Junior; +Cc: Mikhail Kryshen, guix-devel

Hello everyone,

Maxime Devos <maximedevos@telenet.be> writes:
> I think that ideally, the tramp package in Guix would be patched to
> recognise ~/.guix-profile/etc/profile and /etc/profile (when present,
> on the remote machine) and use that to determine the PATH for the
> remote machine (or some other system, whatever works) .
>
> Thne tramp would work out-of-the-box, without having to consult a
> cookbook or manual and without having to know that this information is
> located there.
>
> Greetings,
> Maxime.

Unfortunately, this would only work for Guix-to-Guix tramp connections.
I think the generic 'tramp-own-remote-path is better suited for this, as
it uses the login shell of the target user to find the proper PATH,
something that is much more robust than TRAMP's default (and works 100%
with Guix).  Maybe it could belong in a `Guix-specific application
setup tips` section in the cookbook or manual?

Best,
-- 
Josselin Poiret


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: emacs tramp in remote guix
  2022-02-13  9:52           ` Josselin Poiret
@ 2022-02-16 10:43             ` Max Brieiev
  0 siblings, 0 replies; 7+ messages in thread
From: Max Brieiev @ 2022-02-16 10:43 UTC (permalink / raw)
  To: guix-devel

Also in latest master, Emacs exposed new user options
connection-local-profile-alist and connection-local-criteria-alist.

On guix machine dired complained, when I used /sudo:: about missing ls command,
and the following fixed it for me:

(add-to-list 'connection-local-profile-alist
             '(tramp-guix-connection-local (tramp-remote-path tramp-own-remote-path)))

(add-to-list 'connection-local-criteria-alist
             `((:application tramp :protocol "sudo" :machine ,(system-name))
               tramp-guix-connection-local))


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-02-16 13:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87h795s97x.fsf.ref@yahoo.com.br>
2022-02-11 15:40 ` emacs tramp in remote guix Antonio Carlos Padoan Junior
2022-02-12  2:42   ` Mikhail Kryshen
2022-02-12 11:30     ` Josselin Poiret
2022-02-12 18:04       ` Antonio Carlos Padoan Junior
2022-02-12 18:14         ` Maxime Devos
2022-02-13  9:52           ` Josselin Poiret
2022-02-16 10:43             ` Max Brieiev

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).