Thank you for the reply! I’ve followed your instructions:
Deleted the cache
[user@nixos:~]$ rm -rf ~/.cache/appimage-run/
Registered Appimage files as binary type
[user@nixos:~]$ cat /etc/nixos/configuration.nix
{
...
boot.binfmt.registrations.appimage = {
wrapInterpreterInShell = false;
interpreter = "${pkgs.appimage-run}/bin/appimage-run";
recognitionType = "magic";
offset = 0;
mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
magicOrExtension = ''\x7fELF....AI\x02'';
};
...
}
[user@nixos:~]$ sudo nixos-rebuild switch
building Nix...
building the system configuration...
activating the configuration...
setting up /etc...
reloading user units for user...
setting up tmpfiles
Run the Appimage normally
[user@nixos:~/Downloads]$ appimage-run Snipaste
Uncompress Snipaste of type 02 @ offset 189632
[======================================================================================================================================|] 929/929 100%
Snipaste is now installed in /home/user/.cache/appimage-run/549bf0dccd4e85f8e2fcfa08c67e2073d29c165e87d704585b93db7f5a79ae58
[user@nixos:~/Downloads]$ cd /home/user/.cache/appimage-run/549bf0dccd4e85f8e2fcfa08c67e2073d29c165e87d704585b93db7f5a79ae58
[user@nixos:~/.cache/appimage-run/549bf0dccd4e85f8e2fcfa08c67e2073d29c165e87d704585b93db7f5a79ae58]$ ./AppRun
bash: ./AppRun: cannot execute: required file not found
But it still treated appimage like an archive, and still the “binaries” don’t work. I just started using NixOS and probably I’m missing something crucial, can you please help me?
Try running it directly without appimage-run. You should be able to since you’ve registered it as a binary type. If that doesn’t work, it’s likely an issue with the appimage expecting a dependency not included in appimage-run. You can also try using steam-run ./{appimage}
I do not know if it is worth encouraging this approach, but my personal approach has been to use Nix-LD for this, as I recently mentioned in another thread. I hope it’s not a problem to keep linking to my own personal configuration, but my configuration for this can be found here.
It currently looks like this, omitting comments and unrelated bits:
This has the benefit of making a lot of standalone Linux binaries “just work” as long as they don’t make too many assumptions about FHS, it doesn’t interfere with the operation of patched binaries in the Nix store. and it isn’t broken by LD_LIBRARY_PATH getting changed somewhere between the wrapper and the actual executables. I also use this configuration to make sure /bin/bash exists: