Nix 2.29.1
Nix, the purely functional package manager: C API (experimental)
Loading...
Searching...
No Matches
nix_api_flake.h
Go to the documentation of this file.
1#ifndef NIX_API_FLAKE_H
2#define NIX_API_FLAKE_H
11
12#include "nix_api_fetchers.h"
13#include "nix_api_store.h"
14#include "nix_api_util.h"
15#include "nix_api_expr.h"
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20// cffi start
21
28
35
45
53
61
62// Function prototypes
70
75
87 nix_c_context * context, nix_flake_settings * settings, nix_eval_state_builder * builder);
88
94
101
111 nix_c_context * context,
113 const char * baseDirectory,
114 size_t baseDirectoryLen);
115
121
128
138
148
158
170 nix_c_context * context, nix_flake_lock_flags * flags, const char * inputPath, nix_flake_reference * flakeRef);
171
180 nix_c_context * context,
181 nix_fetchers_settings * fetchSettings,
182 nix_flake_settings * settings,
183 EvalState * eval_state,
184 nix_flake_lock_flags * flags,
185 nix_flake_reference * flake);
186
193
212 nix_c_context * context,
213 nix_fetchers_settings * fetchSettings,
214 nix_flake_settings * flakeSettings,
216 const char * str,
217 size_t strLen,
218 nix_flake_reference ** flakeReferenceOut,
219 nix_get_string_callback fragmentCallback,
220 void * fragmentCallbackUserData);
221
230
239 nix_c_context * context, nix_flake_settings * settings, EvalState * evalState, nix_locked_flake * lockedFlake);
240
241#ifdef __cplusplus
242} // extern "C"
243#endif
244
245#endif
void(* nix_get_string_callback)(const char *start, unsigned int n, void *user_data)
Called to get the value of a string owned by Nix.
Definition nix_api_util.h:133
nix_err
Type for error codes in the Nix system.
Definition nix_api_util.h:59
struct nix_value nix_value
A Nix language value, or thunk that may evaluate to a value.
Definition nix_api_expr.h:62
struct nix_eval_state_builder nix_eval_state_builder
Builder for EvalState.
Definition nix_api_expr.h:36
nix_err nix_flake_lock_flags_set_mode_check(nix_c_context *context, nix_flake_lock_flags *flags)
Put the lock flags in a mode that checks whether the lock is up to date.
struct nix_flake_lock_flags nix_flake_lock_flags
Parameters for locking a flake.
Definition nix_api_flake.h:52
struct nix_flake_reference_parse_flags nix_flake_reference_parse_flags
Context and paramaters for parsing a flake reference.
Definition nix_api_flake.h:34
struct nix_locked_flake nix_locked_flake
A flake with a suitable lock (file or otherwise)
Definition nix_api_flake.h:60
nix_err nix_flake_settings_add_to_eval_state_builder(nix_c_context *context, nix_flake_settings *settings, nix_eval_state_builder *builder)
Initialize a nix_flake_settings to contain builtins.getFlake and potentially more.
nix_flake_reference_parse_flags * nix_flake_reference_parse_flags_new(nix_c_context *context, nix_flake_settings *settings)
A new nix_flake_reference_parse_flags with defaults.
nix_flake_lock_flags * nix_flake_lock_flags_new(nix_c_context *context, nix_flake_settings *settings)
A new nix_flake_lock_flags with defaults.
struct nix_flake_settings nix_flake_settings
A settings object for configuring the behavior of the nix-flake-c library.
Definition nix_api_flake.h:27
void nix_flake_reference_free(nix_flake_reference *store)
Deallocate and release the resources associated with a nix_flake_reference.
struct nix_flake_reference nix_flake_reference
A reference to a flake.
Definition nix_api_flake.h:44
nix_err nix_flake_lock_flags_add_input_override(nix_c_context *context, nix_flake_lock_flags *flags, const char *inputPath, nix_flake_reference *flakeRef)
Add input overrides to the lock flags.
void nix_flake_reference_parse_flags_free(nix_flake_reference_parse_flags *flags)
Deallocate and release the resources associated with a nix_flake_reference_parse_flags....
nix_err nix_flake_lock_flags_set_mode_virtual(nix_c_context *context, nix_flake_lock_flags *flags)
Put the lock flags in a mode that updates the lock file in memory, if needed.
nix_locked_flake * nix_flake_lock(nix_c_context *context, nix_fetchers_settings *fetchSettings, nix_flake_settings *settings, EvalState *eval_state, nix_flake_lock_flags *flags, nix_flake_reference *flake)
Lock a flake, if not already locked.
void nix_flake_settings_free(nix_flake_settings *settings)
Release the resources associated with a nix_flake_settings.
void nix_locked_flake_free(nix_locked_flake *locked_flake)
Deallocate and release the resources associated with a nix_locked_flake. Does not fail.
void nix_flake_lock_flags_free(nix_flake_lock_flags *settings)
Deallocate and release the resources associated with a nix_flake_lock_flags. Does not fail.
nix_value * nix_locked_flake_get_output_attrs(nix_c_context *context, nix_flake_settings *settings, EvalState *evalState, nix_locked_flake *lockedFlake)
Get the output attributes of a flake.
nix_flake_settings * nix_flake_settings_new(nix_c_context *context)
nix_err nix_flake_lock_flags_set_mode_write_as_needed(nix_c_context *context, nix_flake_lock_flags *flags)
Put the lock flags in a mode that updates the lock file on disk, if needed.
nix_err nix_flake_reference_and_fragment_from_string(nix_c_context *context, nix_fetchers_settings *fetchSettings, nix_flake_settings *flakeSettings, nix_flake_reference_parse_flags *parseFlags, const char *str, size_t strLen, nix_flake_reference **flakeReferenceOut, nix_get_string_callback fragmentCallback, void *fragmentCallbackUserData)
Parse a URL-like string into a nix_flake_reference.
nix_err nix_flake_reference_parse_flags_set_base_directory(nix_c_context *context, nix_flake_reference_parse_flags *flags, const char *baseDirectory, size_t baseDirectoryLen)
Provide a base directory for parsing relative flake references.
Main entry for the libexpr C bindings.
Main entry for the libstore C bindings.
Main entry for the libutil C bindings.
Represents a state of the Nix language evaluator.
This object stores error state.