Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init compatibility with: nix bundle, nix run, lib.getExe #306

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

DavHau
Copy link
Member

@DavHau DavHau commented Apr 15, 2024

This makes all devshells compatible with lib.getExe, nix runand nix bundle by setting meta.mainProgram and creating an executable under $out/bin/${meta.mainProgram}

Also remove the now unnecessary flakeApp workaround from the docs and replace it with updated instructions.

My main motivation behind this is to create portable executable devshells via nix bundle.
For example, to bundle the devShell of devshell itself into a static executable:

nix bundle --bundler github:DavHau/nix-portable github:numtide/devshell#devShells.x86_64-linux.default

This makes all devshells compatible with `lib.getExe`, `nix run`and `nix bundle` by setting `meta.mainProgram` and creating an executable under `$out/bin/${meta.mainProgram}`

Also remove the now unnecessary flakeApp workaround from the docs and replace it with updated instructions.

My main motivation behind this is to create portable executable devshells via `nix bundle`.
For example, to bundle the devShell of devshell itself into a static executable:

```sh
nix bundle --bundler github:DavHau/nix-portable github:numtide/devshell#devShells.x86_64-linux.default
```
Copy link
Member

@zimbatm zimbatm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zimbatm zimbatm merged commit 2c8e04e into numtide:main Apr 15, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants