Skip to content

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