Appimage direct invocation not working

Following https://wiki.nixos.org/wiki/Appimage

programs.appimage = {enable = true;binfmt = true;};

is set in configuration.nix After downloading an example from https://download.slicer.org/ and invoking it directly as the documentation suggests, it fails:

[nixos:~/Downloads/Slicer-5.10.0-linux-amd64]$ ./Slicer
Could not start dynamically linked executable: ./Slicer
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:

which is not straightforward. Any ideas as to what the problem might be?

well, its not an appimage, so configuring this is useless.

here is an attempt with nix-ld, but considering the effort here, i guess you should just package it outright. also, no idea how to fix the qt platform plugin error.

    programs.nix-ld = {
        enable = true;
        # put necessary libraries here (figure them out with ldd)
        libraries = with pkgs; [ libx11 libxcb libxcb-wm libxcb-image libxcb-util libxcb-keysyms libxcb-render-util libxext libsm libice libxkbcommon pcre2 glib libGL libpulseaudio nss nspr libxcomposite libxdamage libxfixes libxrender libxrandr freetype expat fontconfig libxcursor libxi libxtst dbus alsa-lib libGLU ];
    };

download the tar file, untar Slicer-5.10.0-*.tar.gz, cd into it, run ./Slicer

1 Like

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.

Other than that, it runs flawless. Thanks!

Useful tool, packaging is encouraged.

A binary-only package for it is probably not hard to create with autoPatchelfHook. A from-source package would be more challenging, but from a cursory look at the build instructions, not too painfully so.