about summary refs log tree commit diff
path: root/tvix/derivation/src/write.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-01-04 r/5589 refactor(tvix/derivation): make output hashes an Option<Hash>Florian Klink1-19/+18
This conveys better if an output of a Derivation is fixed-output or not, and provides a Hash struct that can be used to store the algo and digest. In case it's not, this can simply be None. The serde field attributes have been updated to still accept the same JSON. We currently still store the hash algo and digest as strings, mostly because the only thing populating it so far is the example JSONs. We might want to update this, once actual Nix code populates this. While updating write.rs, I pushed some of the Vec<String> to [&str] conversions inline, and made it a Vec<&str>, because it was annoying to juggle with. Change-Id: Ia9cd0568fe179ac22a4a636237f22ab4ad92b95b Reviewed-on: https://cl.tvl.fyi/c/depot/+/7746 Tested-by: BuildkiteCI Reviewed-by: jrhahn <mail.jhahn@gmail.com> Reviewed-by: tazjin <tazjin@tvl.su>
2023-01-04 r/5587 refactor(tvix/derivation): use tvix_store::nixpath::STORE_DIRFlorian Klink1-1/+0
There's now a common constant for this, so we don't need to redefine it here. Change-Id: I48b096f5e623e5fc5bbd355db83b674766935f94 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7753 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2023-01-04 r/5580 feat(tvix/derivation): add nix drv path generation to DerivationJürgen Hahn1-3/+8
This adds a function to generate the derivation path. The computation is based on the Go implementation. Change-Id: Iae89db4976f5fd9208f0453f73688689a245cd66 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7729 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2023-01-04 r/5577 feat(tvix/derivation) Add fmt::Display implementation for DerivationJürgen Hahn1-13/+21
This adds the implementation of fmt::Display for Derivation so that we can easily store the formatted content as a string. Internally, we use the serialization function to generate the string. Change-Id: I6caca0d6c1bea3ca44b6c535c5b1d5d66d8413b7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7741 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2023-01-02 r/5564 refactor(tvix/derivation): refactor the derivation serializationJürgen Hahn1-0/+174
This refactors the code to serialize a derivation. The original code has beed moved to seperate crates for better code structure. Change-Id: I3b1a6b134428fcbc9930c330bced8ec3610cfb4c Reviewed-on: https://cl.tvl.fyi/c/depot/+/7733 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>