Allow injecting new binaries inside builds under tests in F2 #1091

Open
opened 2026-01-03 20:47:57 +00:00 by raito · 3 comments
Owner

I'd like to add new binaries inside builds under tests in F2, such as acl binaries (setfacl) or more.

Describe the solution you'd like

I'd like to do nix.env.path.add_program("setfacl") and be done with it.

Describe alternatives you've considered

  • Passing the information of the absolute path myself.

Additional context

This is blocked architecturally because get_global_asset has no access to the ambient nix: Nix which knows about where is the full path, we can only pass this information from the parent derivation in package.nix which is not enough for test instrumentation to dynamically extend these PATHs.

In addition, consider the special case where ldd $(which setfacl) requires libraries that are not present inside the sandbox and therefore consider either making it easy to inject pkgsStatic.xxx variants or pull the entire library closure.

## Is your feature request related to a problem? Please describe. I'd like to add new binaries inside builds under tests in F2, such as `acl` binaries (`setfacl`) or more. ## Describe the solution you'd like I'd like to do `nix.env.path.add_program("setfacl")` and be done with it. ## Describe alternatives you've considered - Passing the information of the absolute path myself. ## Additional context This is blocked architecturally because `get_global_asset` has no access to the ambient `nix: Nix` which knows about where is the full path, we can only pass this information from the parent derivation in `package.nix` which is not enough for test instrumentation to dynamically extend these PATHs. In addition, consider the special case where `ldd $(which setfacl)` requires libraries that are not present inside the sandbox and therefore consider either making it easy to inject `pkgsStatic.xxx` variants or pull the entire library closure.

potentially provide the path (and the other replacement variables) via argstr instead of file templating which is done at setup time instead of run time

potentially provide the path (*and the other replacement variables*) via `argstr` instead of file templating which is done at setup time instead of run time

alternatively load the path from another file which is being written at run time within the test

alternatively load the path from another file which is being written at run time within the test

tbh, i'd overall prefer to get rid of the template of config.nix it is just a bunch of overhead for a partially working thing which breaks when one looks at it wrong.
if possible, all injections should be handled by the nix.py

tbh, i'd overall prefer to get rid of the template of `config.nix` it is just a bunch of overhead for a partially working thing which breaks when one looks at it wrong. if possible, all injections should be handled by the `nix.py`
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1091
No description provided.