diff options
Diffstat (limited to 'tvix/nix-compat/src/derivation/mod.rs')
-rw-r--r-- | tvix/nix-compat/src/derivation/mod.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tvix/nix-compat/src/derivation/mod.rs b/tvix/nix-compat/src/derivation/mod.rs index a06f8eb160ae..d7f894c89a8f 100644 --- a/tvix/nix-compat/src/derivation/mod.rs +++ b/tvix/nix-compat/src/derivation/mod.rs @@ -8,8 +8,9 @@ use std::collections::{BTreeMap, BTreeSet}; use std::io; mod errors; -mod escape; mod output; +mod parse_error; +mod parser; mod validate; mod write; @@ -89,6 +90,12 @@ impl Derivation { buffer } + /// Parse an Derivation in ATerm serialization, and validate it passes our + /// set of validations. + pub fn from_aterm_bytes(b: &[u8]) -> Result<Derivation, parser::Error<&[u8]>> { + parser::parse(b) + } + /// Returns the drv path of a [Derivation] struct. /// /// The drv path is calculated by invoking [build_text_path], using |