Neovim as a flatpak

Neovim as a flatpak

Why

There is a great benefit of using a stable OS like Debian stable. Not too much updates and very well tested solid ground.

For myself I don't like to dig into the deep of the OS itself, so it doesn't make sense to have the latest and greatest there.

Which gives me the ability to be a little more experimental when it comes to userspace software. For apps like Freecad or Inkscape it makes perfect sense to install them isolated, so that I can use the latest version independent of a debian release.

I know this can be controversial, but having the option is always great.

This should be only the norm for large userspace stuff, that is hard to test for the debian team anyway and usually doesn't have a lot of interconnection to other system software.

So why the editor then? Makes no sense right?

Neovim

Neovim can be used as an editor which in this case it makes no sense to install it as a flatpak, because the editor should have access to everything, and neovim does its job already nicely with the packaged version in bookworm.

However I use it for EVERYTHING. Which makes it a IDE, Markdown editor... I even let it speak out text for me.

Also it is very heavily developed, so it makes sense to have the latest version. And I don't want to install it from source because I want to have my debian boobworm clean.

So how did it go?

Flatpak version on flathub

The inofficial version on flathub works great. There is just a couple of things to consider.

  • Give it alot of permissions in flatseal. Its still fine to have it access to the hole filesystem.
  • The init.lua stuff goes to ~/.var/app/io.neovim.nvim/config/nvim
  • There should be a python venv in ~ or whereever you like, where init.lua points at, and has the permission for it.
  • With this it still doesn't have access to the $PATH. So I just copied the needed tools like rg and fd to: ~/.var/app/io.neovim.nvim/data/cargo/bin. => If there is a better way of doing this, I would highly appreciate to know.
  • Now install some runtimes like
flatpak install org.freedesktop.Sdk.Extension.node
flatpak install org.freedesktop.Sdk.Extension.rust-stable
  • Add them with flatseal as Env variables: FLATPAK_ENABLE_SDK_EXT=node18, rust-stable

Combine with a flatpak terminal

When using a terminal that is itself in a flatpak container, make shure to give that one many permissions as well. Mainly it needs to be able to be run in the background. Sometimes I still have trouble when switching windows in gnome. But it works 😆

Final thought

Like this I already was able to upgrade to the latest neovim on a debian stable installation without a problem and just doing a flatpak update. As long as there is a flatpak neovim package maintained of course. It makes the installation a bit trickier and some things have rough edges, but so far the experience is not too bad. Would I recomment it? As mentioned above, not if you use it as the editor for editing on the filesystem, but as a dev and overall tool? Thats a yes.