Skip to main content

nix_derivation_from_json

Function nix_derivation_from_json 

Source
pub unsafe extern "C" fn nix_derivation_from_json(
    context: *mut nix_c_context,
    store: *mut Store,
    json: *const c_char,
) -> *mut nix_derivation
Expand description

Create a nix_derivation from a JSON representation of that derivation.

Note Unlike nix_derivation_to_json, this needs a Store. This is because over time we expect the internal representation of derivations in Nix to differ from accepted derivation formats. The store argument is here to help any logic needed to convert from JSON to the internal representation, in excess of just parsing.

§Arguments

  • context [out] - Optional, stores error information.
  • store [in] - nix store reference.
  • json [in] - JSON of the derivation as a string.

§Returns

A new derivation, or NULL on error. Free with nix_derivation_free when done using the nix_derivation.