feat(emacs/tramp): add NixOS support for TRAMP connections

This commit is contained in:
Lucien Cartier-Tilet 2025-05-24 21:20:20 +02:00
parent 57a5be3183
commit 20ac94c9fb
Signed by: phundrak
SSH Key Fingerprint: SHA256:CE0HPsbW3L2YiJETx1zYZ2muMptaAqTN2g3498KrMkc

View File

@ -460,6 +460,7 @@ supported natively. I will describe them here.
(use-package tramp
:straight (tramp :type built-in :build t)
:config
<<tramp-nixos>>
<<tramp-add-yadm>>
(setopt tramp-ssh-controlmaster-options nil
tramp-verbose 0
@ -469,6 +470,19 @@ supported natively. I will describe them here.
(cons tramp-file-name-regexp nil)))
#+end_src
*** SSHing into NixOS remotes
When using TRAMP to SSH into remote NixOS hosts, the true =$PATH= gets
truncated, rendering some binaries unavailable, such as =git= or =nil= (an
LSP server for the Nix language). To fix that, we simply need to write
the following code.
#+name: tramp-nixos
#+begin_src emacs-lisp :tangle no
(require 'tramp-sh)
(setq tramp-remote-path (append tramp-remote-path
'(tramp-own-remote-path)))
#+end_src
*** Yadm
[[https://yadm.io/][~yadm~]] is a git wrapper made to easily manage your dotfiles. It has
loads of features I dont use (the main one I like but dont use is