Skip to content

patchpkg: lookPath helper to find nix binaries #2247

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

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

gcurtis
Copy link
Collaborator

@gcurtis gcurtis commented Sep 3, 2024

When running inside a Nix derivation the PATH is completely empty, so functions like exec.Command("bash") don't work. To make dealing with this easier, add a helper function that looks for an environment variable named after the command and returns $cmd/bin/cmd (e.g., bash becomes $bash/bin/bash). This will automatically find build-time dependencies that are added as attributes to the derivation.

When running inside a Nix derivation the PATH is completely empty, so
functions like `exec.Command("bash")` don't work. To make dealing with
this easier, add a helper function that looks for an environment
variable named after the command and returns `$cmd/bin/cmd` (e.g.,
`bash` becomes `$bash/bin/bash`). This will automatically find
build-time dependencies that are added as attributes to the derivation.
@gcurtis gcurtis merged commit 38b8144 into main Sep 3, 2024
24 checks passed
@gcurtis gcurtis deleted the gcurtis/patchpkg-lookpath branch September 3, 2024 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants