Add package to AppImage-run without write a new derivation

I want to run Netron. It’s distributed as AppImage. So I tried to use appimage-run to run it:

❯ appimage-run Netron-4.8.1.AppImage                                                                                            
Netron-4.8.1.AppImage installed in /home/thiago/.cache/appimage-run/57c7da4d85636014e68318f0f00c401350a2c50d4cedbb9f4a03b3605206b17f
/home/thiago/.cache/appimage-run/57c7da4d85636014e68318f0f00c401350a2c50d4cedbb9f4a03b3605206b17f/netron: error while loading shared libraries: cannot open shared object file: No such file or directory

It seems to that xorg.libxshmfence is not included in appimage-run environment. Is it possible to add xorg.libxshmfence or other package inside of appimage-run environment without write a new derivation?

The short answer is: No it is no possible without making a new derivation

The longer answer is that since making new derivations that slightly alter or fix existing derivations is so common derivations usually have extension points that make doing this slightly less painful.

As an example if you are using NixOS you can add your missing library to the system installed appimage-run with this snippet:

  environment.systemPackages = with pkgs; [
    (appimage-run.override {
      extraPkgs = pkgs: [ pkgs.xorg.libxshmfence ];
1 Like

It would be cool if NixOS had some thing like nix-shell but to FHS envs, something like:

nix-fsh-shell -p default_fhs python3 latex xorg.libxshmfence

So a new FHS would be created with the default packages (like appimageTools.defaultFhsEnvArgs.multiPkgs), python3, latex and xorg.libxshmfence

This is the only answer I have come across on the entire internet, so forgive me for reviving this thread, as I have no other leads.

I used that code snippet in my configuration, yet it did not help, at all. The AppImage still won’t find that library. Rebuilding and upgrading all configuration several times, did not help.

Is there any documentation on this? All I find are posts saying "just use appimage-run", like yeah, no kidding. I am already using it. The library is still not found, though.

There are probably tons of libraries being contacted by AppImages, causing such issues, so I assume I am by far not the only one with this issue.

This issue did not help much, either. It’s also marked as solved, which it obviously isn’t.