Module tvix_glue::tvix_build
source Β· Expand description
This module contains glue code translating from nix_compat::derivation::Derivation to tvix_build::buildservice::BuildRequest.
Constants§
- NIX_ENVIRONMENT_VARS πThese are the environment variables that Nix sets in its sandbox for every build.
Functions§
- For a given key k in a derivation environment thatβs supposed to be passed as file, calculate the ${k}Path key and filepath value that itβs being replaced with while preparing the build. The filepath is
/build/.attrs-${nixbase32(sha256(key))
. - Takes a Derivation and turns it into a [buildservice::BuildRequest]. It assumes the Derivation has been validated. It needs two lookup functions:
- get_refscan_needles πGet an iterator of store paths whose nixbase32 hashes will be the needles for refscanning Importantly, the returned order will match the one used by derivation_to_build_request so users may use this function to map back from the found needles to a store path
- handle_pass_as_file πhandle passAsFile, if set. For each env $x in that list, the original env is removed, and a $xPath environment var added instead, referring to a path inside the build with the contents from the original env var.