Module builder

Module builder 

Source
Expand description

This module contains glue code translating from [nix_compat::derivation::Derivation] to snix_build::buildservice::BuildRequest.

ModulesΒ§

export_reference_graph
structured_attrs
Contains code modifying BuildRequest to honor structuredAttrs functionality.

ConstantsΒ§

NIX_ENVIRONMENT_VARS πŸ”’
These are the environment variables that Nix sets in its sandbox for every build.

FunctionsΒ§

calculate_pass_as_file_env πŸ”’
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)).
derivation_into_build_request πŸ”’
Takes a [Derivation] and turns it into a snix_build::buildservice::BuildRequest. It assumes the Derivation has been validated, and all referenced output paths are present in inputs.
get_all_inputs πŸ”’
Get a stream of a transitive input closure for a derivation. It’s used for input propagation into the build and nixbase32 needle propagation for build output refscanning.
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.
replace_placeholders πŸ”’
Replace all references to placeholder outputName inside the derivation
replace_placeholders_b πŸ”’
Replace all references to placeholder outputName inside the derivation