Appimage documentation

The wiki appimage documentation is pretty brief and seems to suggest running an appimage is the extremely straightfoward process of executing it using appimage-run. But as far as I understand it, you also have to craft an appropriate nix-shell environment that includes any dependencies an appimage needs before it’ll run. I’ve never been able to run an appimage and the process of getting them to work is still a mystery to me. I think the article should mention that extra work is involved with getting many appimages to run.

The three I’ve tried recently were anytype, lume, and postman. I want to run Cura to do some 3D print jobs. Plenty enough motivation for me to learn how to create derivations, but I don’t quite know where to start.

I got one to run using mkShell:

{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
  buildInputs = with pkgs; [
    libthai
    appimage-run
  ];  

  shellHook = ''
    export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [ pkgs.libthai ]}:$LD_LIBRARY_PATH
    appimage-run ./lume_3.0.1_amd64.AppImage
  '';
}
appimage-run.override { extraPkgs = pkgs: [ pkgs.libthai ]; }

If you’re on NixOS, you can also do:

programs.appimage.enable = true;
programs.appimage.binfmt = true;
programs.appimage.package = pkgs.appimage-run.override { extraPkgs = pkgs: [ pkgs.libthai ]; };

which will allow you to run appimages transparently using ./lume_3.0.1_amd64.AppImage in any context (no shell necessary) and will have the library you require included.

Speaking of which: If libthai is something appimages commonly require, it should also be added to appimage-run’s default libraries. That library appears to be for thai language support which may have been missed as many contributors simply haven’t had a need for it. If you run into another appimage that requires this library, please speak out or even just create a PR.

2 Likes