Standardised main program detection/way to override it
When bundling a derivation, there's no way to set the main program without modifying the derivation. This is an issue for derivations that have multiple binaries (e.g. nixpkgs#mesa-demos), or just any derivation that hasn't been configured. Plus, the main program detection logic being part of the bundler would likely result it in being inconsistent across bundlers.
I'm the maintainer of https://github.com/ralismark/nix-appimage and I already have gotten two issue related to main program detection, due to having to implement an ad-hoc solution:
- https://github.com/ralismark/nix-appimage/issues/1
- https://github.com/ralismark/nix-appimage/issues/2
I'm not sure if this is the right repo for this issue, so let me know if there's a better place for it.
Maybe a solution could be to have special support for flake.nix "Apps" so it aligns with "nix run"? https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-run.html#apps
EDIT it seems adding outPath can be a workaround (at least for the default bundler):
yanglint = {
type = "app";
program = "${pkgs.libyang}/bin/yanglint";
outPath = "${pkgs.libyang}";
};