Execute toolbox from within (flatpak) Emacs

Hi all,

I’m running Fedora 36 Silverblue.

  • I have Emacs installed in a Flatpak
  • Nodejs installed in a toolbox

I’d like to execute nodejs inside emacs. What’s the proper way to do this?


Hello @jhakimra ,
Welcome to :fedora: !

You could look at what flatpak-spawn can do for you in this regard.

I am going to suggest alternative option which is you can have is you can run emacs and npm inside from toolbox (toolbox can gui as well so you can leverage that and you don’t have to deal with both side IMO)

You may want to check that option as well plus you can create your desktop files and etc. Or yes you may want to check flatpak spawn method

Thanks Steven, and yes, I managed to use flatpak-spawn exactly for this.

I will note that as of today (Jul22, 2022) the latest org.gnu.emacs in Flathub won’t work directly with flatpak-spawn and will require some tweaking1. This is likely gonna change soon.

The notion of having node within the same container as emacs seems slightly annoying to me. The way I look at it, it requires either:

  • installing all my dev runtimes into one big container alongside emacs
  • installing a separate copy of emacs into each container holding a dev runtime

In both cases, it seems less than ideal. I’d rather have emacs be in its stanalone container, and executing runtimes from other containers. flatpak-spawn did the trick to me.

I do appreciate the suggestion, and I do agree that in some cases, co-locating emacs and npm makes sense. I just rather avoiding it.

You can connect to a toolbox instance (or any podman container) using tramp. This is my normal workflow for flatpak’d emacs and it works very well.

Check out GitHub - fejfighter/toolbox-tramp: tramp support for toolbox containers