nix
nix copied to clipboard
WIP: Dynamic derivations
See the tests in https://github.com/obsidiansystems/nix/blob/dynamic-drvs/tests/dyn-drv/ for what is being implemented.
Needs:
- [ ] Make cooler tests
- [ ] RFC draft
- [ ] Unstable feature gate to prevent accidental use
- [ ] Fix Perl bindings
~~Depends on #4594~~ Depends on #3959 Depends on #4543 Depends on #5364
How come you cancelled CI?
I didn't. If some jobs fail others are cancelled. There is one new bug relating to the eval store (I need to get crafty about which drvs are to be found where). Existing bugs were in the JSON output changing for nix build because the derivation keys might not be strings, and perhaps something else also boring.
I have rebased this. It is no failing tests, but i don't think that will be too bad to fix.
:tada: All dependencies have been resolved !
:tada: All dependencies have been resolved !
:tada: All dependencies have been resolved !
:tada: All dependencies have been resolved !
:tada: All dependencies have been resolved !
:tada: All dependencies have been resolved !
The last commit is finally ready for review!
:tada: All dependencies have been resolved !
:tada: All dependencies have been resolved !
That's an MVP for ya!
You'll want to use this with recursive-nix for trying this out with non-trivial builds (writing not a singular drv), but be aware that the interface may change. We want to offer a safer, more limited recursive nix functionality by default, so that a graph of drvs can be constructed, sources can be generated, etc, but that's not been built yet and may or may not use the existing daemon protocol. Again this is experimental. ymmv.
:rocket:
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/rfc-92-status-update/27441/6
Is there any documentation how to use dynamic derivations?
Not enough, that is definitely next on the agenda.
Some parts like the outputOf builtin are documented, but other parts are not (like "text" content addressing derivation outputs) because the original concept was already undocumented! And there is definitely no tutorial yet on putting all the pieces together.
For now, I would look at the tests and imitate what they do. Hopefully that is not too cumbersome.
It seems that dynamic derivations require content addressable store?
Yes. Because derivations themselves are always content addressed, any derivation that produces derivations must be derivation which opts to content-address its outputs.