ralismark / nix-appimage

Convert a nixos derivation into a self-contained binary
MIT License
148 stars 17 forks source link

Bundling local derivations #2

Closed baduhai closed 1 year ago

baduhai commented 2 years ago

How would I go about bundling a derivation that I've written? I've tried the obvious nix bundle --bundler github:ralismark/nix-appimage -f default.nix, but that doesn't seem to work.

ralismark commented 2 years ago

Ah, seems like it'd be hitting an error with the main program detection. That syntax should work otherwise. For arbitrary derivations, meta.mainProgram gets used, falling back to /bin/ if that doesn't exist. The default bundler does this too, but just produces an invalid bundle instead.

Ideally there'll be a standard way of overriding the program name (e.g. for nixpkgs#mesa-demos, which has multiple binaries), but until then I can add a script that specifies the binary to run.

see: