Issues with direnv in Doom Emacs over TRAMP with NixOS on Remote Server

What happened?

Hello everyone,

I’ve been successfully running Emacs in CLI mode over SSH on a remote NixOS server and utilizing the direnv plugin in my init.el for Doom Emacs. However, I’m encountering a challenge when trying to use direnv with TRAMP. Specifically, I can’t seem to get the environment to load when I navigate to a directory on the remote server via a TRAMP connection.

My goal is to edit files on the remote server while commuting, where I often face internet disruptions, making a stable SSH session difficult. TRAMP seemed like the ideal solution, but the direnv environments aren’t loading as expected.

Has anyone experienced similar issues or have insights on configuring direnv to work seamlessly with TRAMP in this setup? Any tips or configurations that could help resolve this would be greatly appreciated.

Thank you in advance!

What did you expect to happen?

I expected direnv to run on the remote system

Steps to reproduce

  1. Open Emacs on client system
  2. Tramp (sshx) to remote system /ssh:box:~/dev/project-dir
  3. direnv fails to run

System information


Loading data dump...