pub struct Derivation {
pub outputs: BTreeMap<String, DerivationOutput>,
pub input_derivations: BTreeMap<String, Vec<String>>,
pub input_sources: Vec<String>,
pub system: String,
pub builder: String,
pub args: Vec<String>,
pub env: BTreeMap<String, String>,
}Expand description
A parsed Nix derivation.
Fields§
§outputs: BTreeMap<String, DerivationOutput>Named outputs (e.g. "out", "dev", "lib").
input_derivations: BTreeMap<String, Vec<String>>Input derivations: maps .drv store path to the list of outputs used.
input_sources: Vec<String>Input source store paths (non-derivation dependencies).
system: StringTarget system triple (e.g. "x86_64-linux").
builder: StringPath to the builder executable.
args: Vec<String>Arguments passed to the builder.
env: BTreeMap<String, String>Environment variables set during the build.
Implementations§
Source§impl Derivation
impl Derivation
Sourcepub fn parse(input: &[u8]) -> Result<Self, DerivationError>
pub fn parse(input: &[u8]) -> Result<Self, DerivationError>
Parse a derivation from its ATerm bytes.
Sourcepub fn serialize_modulo(&self, resolver: impl Fn(&str) -> String) -> String
pub fn serialize_modulo(&self, resolver: impl Fn(&str) -> String) -> String
Serialize to ATerm in “modulo” form: each input_derivations
key (a .drv store path) is replaced by the result of
resolver(drv_path) — CppNix’s hashDerivationModulo
recursion. Used when computing the hash that becomes the
dependent derivation’s store path.
The resolver typically looks up a pre-computed modulo hash
(lowercase hex) in an evaluator-level cache. If the resolver
returns the drv path unchanged, this is identical to
Self::serialize.
§Panics
Does not panic; any resolver-returned string is inserted verbatim.
Trait Implementations§
Source§impl Clone for Derivation
impl Clone for Derivation
Source§fn clone(&self) -> Derivation
fn clone(&self) -> Derivation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Derivation
impl Debug for Derivation
Source§impl Default for Derivation
impl Default for Derivation
Source§fn default() -> Derivation
fn default() -> Derivation
impl Eq for Derivation
Source§impl PartialEq for Derivation
impl PartialEq for Derivation
Source§fn eq(&self, other: &Derivation) -> bool
fn eq(&self, other: &Derivation) -> bool
self and other values to be equal, and is used by ==.