Advice on making appimages on nix

Using GitHub - ralismark/nix-appimage: Convert a nixos derivation into a self-contained binary

EDIT: I have narrowed down the problem space and the actual question.

app-images.${system}.default = nix-appimage.bundlers.${system}.default pkgs.hello;

the app image produced by this cannot access other things installed via nix. Why? Is it because of the chrooting?

like, for example, If I made an appimage that runs another program from the path. I then globally install that program to my path via nix. Then I run the appimage. The other program is not able to be ran via the path.

But take that same appimage that runs the program from the path and put it on debian. Install the other program via APT. Now when you run the appimage, it IS able to find it from the path.

I can shove as many derivations as I want into the appimage and it can find them. I can call stuff from the global path and it will find it, as long as that thing was not added to the path via nix.

Is there a way around this? Is it because of the chroot? Is there a “look at me, IM /nix now” meme that Im missing and would have posted myself if I understood? Can I like, make some sorta link farm that will combine the system /nix with the packaged /nix at runtime if the system /nix exists so that it can find the stuffs?

To be fair Im not sure this is the biggest problem because obviously if I was on nix, I would just install it via nix and not the app image. But would there be other issues I should be aware of?

I’ve built appimages with nix. It works well. I don’t understand what you’re trying to do, but here’s an example flake.nix · main · Emmanuel Rosa / sm64nix · GitLab and her’s another GitHub - emmanuelrosa/gossip-appimage: A Nix flake which builds an AppImage of the Gossip Nostr client

Thank you for the resources. It works fantastically except the PATH is sandboxed from the system. Other than that thats kinda the only issue left that I havent figured out.

Obviously id prefer if the text editor had access to the system’s path XD

Ill take a look at the examples you provided.

Oooh an example of nixGL with it. Nice. AND how to include it as an output. :slight_smile:

I figured out how to include it as an output from your example almost immediately. Will tackle PATH next and I guess thats kinda it.

Im having a couple other issues with stuff not being found too actually its not just PATH apparently. Like, nil_ls cant resolve from the lockfile because it

LSP[nil_ls] Failed to load flake workspace: Failed to resolve flake inputs from lock file: Failed to spawn "nix": No such file or directory (os error 2)

Edit: they go away when I add nix and coreutils-full to the path… nvm its still just the PATH issue.

EDIT: NVM ITS NOT THE PATH

Im getting the path. But it still is giving an error like it cant find those things. Hmmmm…