Module utils

Source

Enums§

BuildStorePathError
Errors that can occur when creating a content-addressed store path.

Functions§

build_ca_path
This builds a store path from a CAHash and a list of references.
build_output_path
This builds an input-addressed store path.
build_store_path_from_fingerprint_parts 🔒
This builds a store path from fingerprint parts. Usually, that function is used from build_text_path and passed a “text hash string” (starting with “text:” as fingerprint), but other fingerprints starting with “output:” are also used in Derivation output path calculation.
build_text_path
This builds a store path, by calculating the text_hash_string of either a derivation or a literal text file that may contain references. If you don’t want to have to pass the entire contents, you might want to use build_ca_path instead.
compress_hash
compress_hash takes an arbitrarily long sequence of bytes (usually a hash digest), and returns a sequence of bytes of length OUTPUT_SIZE.
hash_placeholder
Nix placeholders (i.e. values returned by builtins.placeholder) are used to populate outputs with paths that must be string-replaced with the actual placeholders later, at runtime.
make_references_string 🔒
This contains the Nix logic to create “text hash strings”, which are used in builtins.toFile, as well as in Derivation Path calculation.