Expand description
Structs§
- Bindings
Builder - Eval
State - External
Value - List
Builder - NixC
External Value Desc - Definition for a class of external values Create and implement one of these, then pass it to nix_create_external_value Make sure to keep it alive while the external value lives. Optional functions can be set to NULL
- PrimOp
- Store
- Store
Path - __
fsid_ t - max_
align_ t - nix_
c_ context - nix_
derivation - nix_
eval_ state_ builder - nix_
fetchers_ settings - nix_
flake_ lock_ flags - nix_
flake_ reference - nix_
flake_ reference_ parse_ flags - nix_
flake_ settings - nix_
locked_ flake - nix_
printer - nix_
realised_ string - nix_
store_ path_ hash_ part - A store path hash Once decoded from “nix32” encoding, a store path hash is 20 raw bytes.
- nix_
string_ context - nix_
string_ return - nix_
value
Constants§
- INT8_
MAX - INT8_
MIN - INT16_
MAX - INT16_
MIN - INT32_
MAX - INT32_
MIN - INTPTR_
MAX - INTPTR_
MIN - INT_
FAST8_ MAX - INT_
FAST8_ MIN - INT_
FAST16_ MAX - INT_
FAST16_ MIN - INT_
FAST32_ MAX - INT_
FAST32_ MIN - INT_
LEAS T8_ MAX - INT_
LEAS T8_ MIN - INT_
LEAS T16_ MAX - INT_
LEAS T16_ MIN - INT_
LEAS T32_ MAX - INT_
LEAS T32_ MIN - PTRDIFF_
MAX - PTRDIFF_
MIN - SIG_
ATOMIC_ MAX - SIG_
ATOMIC_ MIN - SIZE_
MAX - UINT8_
MAX - UINT16_
MAX - UINT32_
MAX - UINTPTR_
MAX - UINT_
FAST8_ MAX - UINT_
FAST16_ MAX - UINT_
FAST32_ MAX - UINT_
LEAS T8_ MAX - UINT_
LEAS T16_ MAX - UINT_
LEAS T32_ MAX - Value
Type_ NIX_ TYPE_ ATTRS - Attribute set (key-value mapping)
- Value
Type_ NIX_ TYPE_ BOOL - Boolean true or false value
- Value
Type_ NIX_ TYPE_ EXTERNAL - External value from C++ plugins or C API
- Value
Type_ NIX_ TYPE_ FAILED - External value from C++ plugins or C API
- Value
Type_ NIX_ TYPE_ FLOAT - IEEE 754 double precision floating point number
- Value
Type_ NIX_ TYPE_ FUNCTION - Function (lambda or builtin)
- Value
Type_ NIX_ TYPE_ INT - A 64 bit signed integer.
- Value
Type_ NIX_ TYPE_ LIST - Ordered list of values
- Value
Type_ NIX_ TYPE_ NULL - Null value
- Value
Type_ NIX_ TYPE_ PATH - Filesystem path
- Value
Type_ NIX_ TYPE_ STRING - String value with context String content may contain arbitrary bytes, not necessarily UTF-8.
- Value
Type_ NIX_ TYPE_ THUNK - Unevaluated expression Thunks often contain an expression and closure, but may contain other representations too. Their state is mutable, unlike that of the other types.
- WINT_
MAX - WINT_
MIN - _ATFILE_
SOURCE - _BITS_
STDINT_ INTN_ H - _BITS_
STDINT_ LEAST_ H - _BITS_
STDINT_ UINTN_ H - _BITS_
TIME64_ H - _BITS_
TYPESIZES_ H - _BITS_
TYPES_ H - _BITS_
WCHAR_ H - _DEFAULT_
SOURCE - _FEATURES_
H - _POSIX_
C_ SOURCE - _POSIX_
SOURCE - _STDC_
PREDEF_ H - _STDINT_
H - _SYS_
CDEFS_ H - __
FD_ SETSIZE - __
GLIBC_ MINOR__ - __
GLIBC_ USE_ C23_ STRTOL - __
GLIBC_ USE_ DEPRECATED_ GETS - __
GLIBC_ USE_ DEPRECATED_ SCANF - __
GLIBC_ USE_ IEC_ 60559_ BFP_ EXT - __
GLIBC_ USE_ IEC_ 60559_ BFP_ EXT_ C23 - __
GLIBC_ USE_ IEC_ 60559_ EXT - __
GLIBC_ USE_ IEC_ 60559_ FUNCS_ EXT - __
GLIBC_ USE_ IEC_ 60559_ FUNCS_ EXT_ C23 - __
GLIBC_ USE_ IEC_ 60559_ TYPES_ EXT - __
GLIBC_ USE_ ISOC2Y - __
GLIBC_ USE_ ISOC23 - __
GLIBC_ USE_ LIB_ EXT2 - __
GLIBC__ - __
GNU_ LIBRARY__ - __
HAVE_ GENERIC_ SELECTION - __
INO_ T_ MATCHES_ INO64_ T - __
KERNEL_ OLD_ TIMEVAL_ MATCHES_ TIMEVA L64 - __
LDOUBLE_ REDIRECTS_ TO_ FLOA T128_ ABI - __
OFF_ T_ MATCHES_ OFF64_ T - __
RLIM_ T_ MATCHES_ RLIM64_ T - __
STATFS_ MATCHES_ STATF S64 - __
STDC_ IEC_ 559_ COMPLEX__ - __
STDC_ IEC_ 559__ - __
STDC_ IEC_ 60559_ BFP__ - __
STDC_ IEC_ 60559_ COMPLEX__ - __
STDC_ ISO_ 10646__ - __
SYSCALL_ WORDSIZE - __
TIMESIZE - __
USE_ ATFILE - __
USE_ FORTIFY_ LEVEL - __
USE_ ISOC11 - __
USE_ ISOC95 - __
USE_ ISOC99 - __
USE_ MISC - __
USE_ POSIX - __
USE_ POSI X2 - __
USE_ POSI X199309 - __
USE_ POSI X199506 - __
USE_ POSIX_ IMPLICITLY - __
USE_ TIME_ BITS64 - __
USE_ XOPE N2K - __
USE_ XOPE N2K8 - __
WORDSIZE - __
WORDSIZE_ TIME64_ COMPA T32 - __
bool_ true_ false_ are_ defined - __
glibc_ c99_ flexarr_ available - false_
- nix_
err_ NIX_ ERR_ KEY - A key/index access error occurred in C API functions. This error code is returned when accessing a key, index, or identifier that does not exist in C API functions. Common scenarios include:
- nix_
err_ NIX_ ERR_ NIX_ ERROR - A generic Nix error occurred. This error code is returned when a generic Nix error occurred during the function execution.
- nix_
err_ NIX_ ERR_ OVERFLOW - An overflow error occurred. This error code is returned when an overflow error occurred during the function execution.
- nix_
err_ NIX_ ERR_ RECOVERABLE - A recoverable error occurred. This is used primarily by C API consumers to communicate that a failed primop call should be retried on the next evaluation attempt.
- nix_
err_ NIX_ ERR_ UNKNOWN - An unknown error occurred. This error code is returned when an unknown error occurred during the function execution.
- nix_
err_ NIX_ OK - No error occurred. This error code is returned when no error has occurred during the function execution.
- nix_
verbosity_ NIX_ LVL_ CHATTY - nix_
verbosity_ NIX_ LVL_ DEBUG - nix_
verbosity_ NIX_ LVL_ ERROR - nix_
verbosity_ NIX_ LVL_ INFO - nix_
verbosity_ NIX_ LVL_ NOTICE - nix_
verbosity_ NIX_ LVL_ TALKATIVE - nix_
verbosity_ NIX_ LVL_ VOMIT - nix_
verbosity_ NIX_ LVL_ WARN - true_
Functions§
- nix_
add_ ⚠derivation - Add the given
nix_derivationto the given store - nix_
alloc_ ⚠primop - Allocate a PrimOp @ingroup primops Call nix_gc_decref() when you’re done with the returned PrimOp.
- nix_
alloc_ ⚠value - Allocate a Nix value @ingroup value_create Call nix_value_decref() when you’re done with the pointer
- nix_
bindings_ ⚠builder_ free - Free a bindings builder Does not fail.
- nix_
bindings_ ⚠builder_ insert - Insert bindings into a builder
- nix_
c_ ⚠context_ create - Allocate a new nix_c_context. @throws std::bad_alloc
- nix_
c_ ⚠context_ free - Free a nix_c_context. Does not fail.
- nix_
clear_ ⚠err - Clear the error message from a nix context. This is performed implicitly by all functions that accept a context, so this won’t be necessary in most cases. However, if you want to clear the error message without calling another function, you can use this. Example use case: a higher order function that helps with error handling, to make it more robust in the following scenario:
- nix_
copy_ ⚠value - Copy from another value @ingroup value_create
- nix_
create_ ⚠external_ value - Create an external value, that can be given to nix_init_external Call nix_gc_decref() when you’re done with the pointer.
- nix_
derivation_ ⚠clone - Copy a
nix_derivation - nix_
derivation_ ⚠free - Deallocate a
nix_derivationDoes not fail. - nix_
derivation_ ⚠from_ json - Create a
nix_derivationfrom a JSON representation of that derivation. - nix_
derivation_ ⚠to_ json - Gets the derivation as a JSON string
- nix_
err_ ⚠code - Retrieves the most recent error code from a nix_c_context Equivalent to reading the first field of the context. Does not fail
- nix_
err_ ⚠info_ msg - Retrieves the error message from errorInfo in a context. Used to inspect nix Error messages. @pre This function should only be called after a previous nix function has returned a NIX_ERR_NIX_ERROR
- nix_
err_ ⚠msg - @addtogroup errors Retrieves the most recent error message from a context. @pre This function should only be called after a previous nix function has returned an error.
- nix_
err_ ⚠name - Retrieves the error name from a context. Used to inspect nix Error messages. @pre This function should only be called after a previous nix function has returned a NIX_ERR_NIX_ERROR
- nix_
eval_ ⚠state_ allow_ path - Register a store path in the evaluator’s access allowlist. In pure evaluation mode (–pure-eval) the Nix evaluator wraps the filesystem in an AllowListSourceAccessor that rejects any path not explicitly permitted. Nix’s own fetch builtins call allowPath after adding a path to the store so that the resulting path value can be used without triggering the access restriction. Call this before nix_init_path_string (or PrimOpRet::set_path) when your primop has added a path to the store and needs to return it as a Nix path value that is usable in pure evaluation mode.
- nix_
eval_ ⚠state_ build - Create a new Nix language evaluator state @ingroup libexpr_init The builder becomes unusable after this call. Remember to call nix_eval_state_builder_free() after building the state.
- nix_
eval_ ⚠state_ builder_ free - Free a nix_eval_state_builder @ingroup libexpr_init Does not fail.
- nix_
eval_ ⚠state_ builder_ load - Read settings from the ambient environment @ingroup libexpr_init Settings are sourced from environment variables and configuration files, as documented in the Nix manual.
- nix_
eval_ ⚠state_ builder_ new - Create a new nix_eval_state_builder @ingroup libexpr_init The settings are initialized to their default value. Values can be sourced elsewhere with nix_eval_state_builder_load.
- nix_
eval_ ⚠state_ builder_ set_ lookup_ path - Set the lookup path for
<...>expressions @ingroup libexpr_init - nix_
expr_ ⚠eval_ from_ string - Parses and evaluates a Nix expression from a string. @ingroup value_create
- nix_
external_ ⚠add_ string_ context - Add string context to the nix_string_context object
- nix_
external_ ⚠print - Print to the nix_printer
- nix_
fetchers_ ⚠settings_ free - nix_
fetchers_ ⚠settings_ new - nix_
flake_ ⚠lock - Lock a flake, if not already locked.
- nix_
flake_ ⚠lock_ flags_ add_ input_ override - Add input overrides to the lock flags
- nix_
flake_ ⚠lock_ flags_ free - Deallocate and release the resources associated with a
nix_flake_lock_flags. Does not fail. - nix_
flake_ ⚠lock_ flags_ new - A new
nix_flake_lock_flagswith defaults - nix_
flake_ ⚠lock_ flags_ set_ mode_ check - Put the lock flags in a mode that checks whether the lock is up to date.
- nix_
flake_ ⚠lock_ flags_ set_ mode_ virtual - Put the lock flags in a mode that updates the lock file in memory, if needed.
- nix_
flake_ ⚠lock_ flags_ set_ mode_ write_ as_ needed - Put the lock flags in a mode that updates the lock file on disk, if needed.
- nix_
flake_ ⚠reference_ and_ fragment_ from_ string - Parse a URL-like string into a
nix_flake_reference. - nix_
flake_ ⚠reference_ free - Deallocate and release the resources associated with a
nix_flake_reference. Does not fail. - nix_
flake_ ⚠reference_ parse_ flags_ free - Deallocate and release the resources associated with a
nix_flake_reference_parse_flags. Does not fail. - nix_
flake_ ⚠reference_ parse_ flags_ new - A new
nix_flake_reference_parse_flagswith defaults - nix_
flake_ ⚠reference_ parse_ flags_ set_ base_ directory - Provide a base directory for parsing relative flake references
- nix_
flake_ ⚠settings_ add_ to_ eval_ state_ builder - Initialize a
nix_flake_settingsto containbuiltins.getFlakeand potentially more. @warning This does not put the eval state in pure mode! - nix_
flake_ ⚠settings_ free - Release the resources associated with a nix_flake_settings.
- nix_
flake_ ⚠settings_ new - Create a nix_flake_settings initialized with default values.
- nix_
gc_ ⚠decref - Decrement the garbage collector reference counter for the given object
- nix_
gc_ ⚠incref - Increment the garbage collector reference counter for the given object. The Nix language evaluator C API keeps track of alive objects by reference counting. When you’re done with a refcounted pointer, call nix_gc_decref().
- nix_
gc_ ⚠now - Trigger the garbage collector manually You should not need to do this, but it can be useful for debugging.
- nix_
gc_ ⚠register_ finalizer - Register a callback that gets called when the object is garbage collected.
- nix_
get_ ⚠attr_ byidx - Get an attribute by index @ingroup value_extract Also gives you the name. Attributes are returned in an unspecified order which is NOT suitable for reproducible operations. In Nix’s domain, reproducibility is paramount. The caller is responsible for sorting the attributes or storing them in an ordered map to ensure deterministic behavior in your application.
- nix_
get_ ⚠attr_ byidx_ lazy - Get an attribute by index, without forcing evaluation of the attribute’s value @ingroup value_extract Also gives you the name. Returns the attribute value without forcing its evaluation, allowing access to lazy values. The attribute set value itself must already have been evaluated. Attributes are returned in an unspecified order which is NOT suitable for reproducible operations. In Nix’s domain, reproducibility is paramount. The caller is responsible for sorting the attributes or storing them in an ordered map to ensure deterministic behavior in your application.
- nix_
get_ ⚠attr_ byname - Get an attr by name @ingroup value_extract Call nix_value_decref() when you’re done with the pointer
- nix_
get_ ⚠attr_ byname_ lazy - Get an attribute value by attribute name, without forcing evaluation of the attribute’s value @ingroup value_extract Returns the attribute value without forcing its evaluation, allowing access to lazy values. The attribute set value itself must already be evaluated. Call nix_value_decref() when you’re done with the pointer
- nix_
get_ ⚠attr_ name_ byidx - Get an attribute name by index @ingroup value_extract Returns the attribute name without forcing evaluation of the attribute’s value. Attributes are returned in an unspecified order which is NOT suitable for reproducible operations. In Nix’s domain, reproducibility is paramount. The caller is responsible for sorting the attributes or storing them in an ordered map to ensure deterministic behavior in your application.
- nix_
get_ ⚠attrs_ size - Get the element count of an attrset @ingroup value_extract
- nix_
get_ ⚠bool - Get boolean value @ingroup value_extract
- nix_
get_ ⚠external - Get external reference @ingroup value_extract
- nix_
get_ ⚠external_ value_ content - Extract the pointer from a Nix C API external value.
- nix_
get_ ⚠float - Get float value in 64 bits @ingroup value_extract
- nix_
get_ ⚠int - Get int value @ingroup value_extract
- nix_
get_ ⚠list_ byidx - Get the ix’th element of a list @ingroup value_extract Call nix_value_decref() when you’re done with the pointer
- nix_
get_ ⚠list_ byidx_ lazy - Get the ix’th element of a list without forcing evaluation of the element @ingroup value_extract Returns the list element without forcing its evaluation, allowing access to lazy values. The list value itself must already be evaluated. Call nix_value_decref() when you’re done with the pointer
- nix_
get_ ⚠list_ size - Get the length of a list @ingroup value_extract
- nix_
get_ ⚠path_ string - Get path as string @ingroup value_extract
- nix_
get_ ⚠string - Get the raw string @ingroup value_extract This may contain placeholders.
- nix_
get_ ⚠type - Get value type @ingroup value_extract
- nix_
get_ ⚠typename - Get type name of value as defined in the evaluator @ingroup value_extract
- nix_
has_ ⚠attr_ byname - Check if an attribute name exists on a value @ingroup value_extract
- nix_
init_ ⚠apply - Set the value to a thunk that will perform a function application when needed. @ingroup value_create Thunks may be put into attribute sets and lists to perform some computation lazily; on demand. However, note that in some places, a thunk must not be returned, such as in the return value of a PrimOp. In such cases, you may use nix_value_call() instead (but note the different argument order).
- nix_
init_ ⚠bool - @name Initializers Values are typically “returned” by initializing already allocated memory that serves as the return value. For this reason, the construction of values is not tied their allocation. Nix is a language with immutable values. Respect this property by only initializing Values once; and only initialize Values that are meant to be initialized by you. Failing to adhere to these rules may lead to undefined behavior. @ingroup value_create
- nix_
init_ ⚠external - Set an external value @ingroup value_create
- nix_
init_ ⚠float - Set a float @ingroup value_create
- nix_
init_ ⚠int - Set an int @ingroup value_create
- nix_
init_ ⚠null - Set null @ingroup value_create
- nix_
init_ ⚠path_ string - Set a path @ingroup value_create
- nix_
init_ ⚠plugins - Loads the plugins specified in Nix’s plugin-files setting. Call this once, after calling your desired init functions and setting relevant settings.
- nix_
init_ ⚠primop - Set primop @ingroup value_create
- nix_
init_ ⚠string - Set a string @ingroup value_create
- nix_
libexpr_ ⚠init - Initialize the Nix language evaluator. @ingroup libexpr_init This function must be called at least once, at some point before constructing a EvalState for the first time. This function can be called multiple times, and is idempotent.
- nix_
libstore_ ⚠init - Initializes the Nix store library This function should be called before creating a Store This function can be called multiple times.
- nix_
libstore_ ⚠init_ no_ load_ config - Like nix_libstore_init, but does not load the Nix configuration. This is useful when external configuration is not desired, such as when running unit tests.
- nix_
libutil_ ⚠init - Initializes nix_libutil and its dependencies. This function can be called multiple times, but should be called at least once prior to any other nix function.
- nix_
list_ ⚠builder_ free - Free a list builder Does not fail.
- nix_
list_ ⚠builder_ insert - Insert bindings into a builder
- nix_
locked_ ⚠flake_ free - Deallocate and release the resources associated with a
nix_locked_flake. Does not fail. - nix_
locked_ ⚠flake_ get_ output_ attrs - Get the output attributes of a flake.
- nix_
make_ ⚠attrs - Create an attribute set from a bindings builder @ingroup value_create After this call, the bindings builder becomes invalid and cannot be used again. The only necessary next step is to free it with nix_bindings_builder_free().
- nix_
make_ ⚠bindings_ builder - Create a bindings builder
- nix_
make_ ⚠list - Create a list from a list builder @ingroup value_create After this call, the list builder becomes invalid and cannot be used again. The only necessary next step is to free it with nix_list_builder_free().
- nix_
make_ ⚠list_ builder - Create a list builder @ingroup value_create
- nix_
realised_ ⚠string_ free - Free a realised string
- nix_
realised_ ⚠string_ get_ buffer_ size - Length of the string
- nix_
realised_ ⚠string_ get_ buffer_ start - Start of the string
- nix_
realised_ ⚠string_ get_ store_ path - Get a store path. The store paths are stored in an arbitrary order.
- nix_
realised_ ⚠string_ get_ store_ path_ count - Number of realised store paths
- nix_
register_ ⚠primop - add a primop to the
builtinsattribute set @ingroup primops Only applies to States created after this call. Moves your PrimOp content into the global evaluator registry, meaning your input PrimOp pointer becomes invalid. The PrimOp must not be used with nix_init_primop() before or after this call, as this would cause undefined behavior. You must call nix_gc_decref() on the original PrimOp pointer after this call to release your reference. - nix_
set_ ⚠err_ msg - Set an error message on a nix context. This should be used when you want to throw an error from a PrimOp callback. All other use is internal to the API.
- nix_
set_ ⚠log_ format - Sets the log format
- nix_
set_ ⚠string_ return - Sets the contents of a nix_string_return Copies the passed string.
- nix_
set_ ⚠verbosity - Sets the verbosity level
- nix_
setting_ ⚠get - @defgroup settings Nix configuration settings Retrieves a setting from the nix global configuration. This function requires nix_libutil_init() to be called at least once prior to its use.
- nix_
setting_ ⚠set - Sets a setting in the nix global configuration.
Use “extra-
” to append to the setting’s value. Settings only apply for new State%s. Call nix_plugins_init() when you are done with the settings to load any plugins. - nix_
state_ ⚠create - Create a new Nix language evaluator state @ingroup libexpr_init For more control, use nix_eval_state_builder
- nix_
state_ ⚠free - Frees a Nix state. @ingroup libexpr_init Does not fail.
- nix_
store_ ⚠add_ bytes_ to_ store - Add raw bytes to the store as a flat, content-addressed file.
Equivalent to Nix’s
builtins.toFile, but accepts arbitrary bytes (including embedded NULs). The content is ingested with the “Text” content-addressing method (flat serialisation, SHA-256). The resulting store path has no references. - nix_
store_ ⚠copy_ closure - Copy the closure of
pathfromsrcStoretodstStore. - nix_
store_ ⚠copy_ path - Copy a path from one store to another.
- nix_
store_ ⚠create_ from_ parts - Create a StorePath from its constituent parts (hash and name) This function constructs a store path from a hash and name, without needing a Store reference or the store directory prefix.
- nix_
store_ ⚠drv_ from_ store_ path - Returns the derivation associated with the store path
- nix_
store_ ⚠free - Deallocate a nix store and free any resources if not also held by other Store instances. Does not fail.
- nix_
store_ ⚠get_ fs_ closure - Gets the closure of a specific store path
- nix_
store_ ⚠get_ storedir - get the storeDir of a Nix store, typically
"/nix/store" - nix_
store_ ⚠get_ uri - get the URI of a nix store
- nix_
store_ ⚠get_ version - get the version of a nix store. If the store doesn’t have a version (like the dummy store), returns an empty string.
- nix_
store_ ⚠is_ valid_ path - Check if a StorePath is valid (i.e. that corresponding store object and its closure of references exists in the store)
- nix_
store_ ⚠open - Open a nix store. Store instances may share state and resources behind the scenes.
- nix_
store_ ⚠parse_ path - Parse a Nix store path that includes the store dir into a StorePath
- nix_
store_ ⚠path_ clone - Copy a StorePath
- nix_
store_ ⚠path_ free - Deallocate a StorePath Does not fail.
- nix_
store_ ⚠path_ hash - Get the path hash (e.g. “
” in /nix/store/ - ) The hash is returned as raw bytes, decoded from “nix32” encoding. - nix_
store_ ⚠path_ name - Get the path name (e.g. “
” in /nix/store/ - ) - nix_
store_ ⚠path_ to_ string - Render a StorePath as its canonical /nix/store/… string.
Calls
store->printStorePath(path)and surfaces the result via the standard get-string callback protocol. Unlikenix_store_path_name, which only returns the name component, this returns the full path including the store directory and hash. - nix_
store_ ⚠query_ path_ from_ hash_ part - Query the full store path given the hash part of a valid store path, or empty if no matching path is found.
- nix_
store_ ⚠real_ path - Get the physical location of a store path
A store may reside at a different location than its
storeDirsuggests. This situation is called a relocated store. Relocated stores are used during NixOS installation, as well as in restricted computing environments that don’t offer a writable/nix/store. Not all types of stores support this operation. - nix_
store_ ⚠realise - Realise a Nix store path Blocking, calls callback once for each realised output.
- nix_
string_ ⚠realise - Realise a string context. This will
- nix_
value_ ⚠call - Calls a Nix function with an argument. @ingroup value_create
- nix_
value_ ⚠call_ multi - Calls a Nix function with multiple arguments. @ingroup value_create Technically these are functions that return functions. It is common for Nix functions to be curried, so this function is useful for calling them.
- nix_
value_ ⚠decref - Decrement the garbage collector reference counter for the given object
@ingroup value
When the counter reaches zero, the
nix_valueobject becomes invalid. The data referenced bynix_valuemay not be deallocated until the memory garbage collector has run, but deallocation is not guaranteed. - nix_
value_ ⚠force - Forces the evaluation of a Nix value.
@ingroup value_create
The Nix interpreter is lazy, and not-yet-evaluated values can be
of type NIX_TYPE_THUNK instead of their actual value.
This function mutates such a
nix_value, so that, if successful, it has its final type. - nix_
value_ ⚠force_ deep - Forces the deep evaluation of a Nix value. Recursively calls nix_value_force
- nix_
value_ ⚠incref - Increment the garbage collector reference counter for the given
nix_value. @ingroup value The Nix language evaluator C API keeps track of alive objects by reference counting. When you’re done with a refcounted pointer, call nix_value_decref(). - nix_
version_ ⚠get - Retrieves the nix library version. Does not fail.
Type Aliases§
- Prim
OpFun - Function pointer for primops @ingroup primops When you want to return an error, call nix_set_err_msg(context, NIX_ERR_UNKNOWN, “your error message here”).
- Value
Deprecated Use nix_value instead
- Value
Type - Represents the state of a Nix value Thunk values (NIX_TYPE_THUNK) change to their final, unchanging type when forced.
- __
blkcnt64_ t - __
blkcnt_ t - __
blksize_ t - __
caddr_ t - __
clock_ t - __
clockid_ t - __
daddr_ t - __dev_t
- __
fsblkcnt64_ t - __
fsblkcnt_ t - __
fsfilcnt64_ t - __
fsfilcnt_ t - __
fsword_ t - __gid_t
- __id_t
- __
ino64_ t - __ino_t
- __
int8_ t - __
int16_ t - __
int32_ t - __
int64_ t - __
int_ least8_ t - __
int_ least16_ t - __
int_ least32_ t - __
int_ least64_ t - __
intmax_ t - __
intptr_ t - __key_t
- __
loff_ t - __
mode_ t - __
nlink_ t - __
off64_ t - __off_t
- __pid_t
- __
quad_ t - __
rlim64_ t - __
rlim_ t - __
sig_ atomic_ t - __
socklen_ t - __
ssize_ t - __
suseconds64_ t - __
suseconds_ t - __
syscall_ slong_ t - __
syscall_ ulong_ t - __
time_ t - __
timer_ t - __
u_ char - __u_int
- __
u_ long - __
u_ quad_ t - __
u_ short - __uid_t
- __
uint8_ t - __
uint16_ t - __
uint32_ t - __
uint64_ t - __
uint_ least8_ t - __
uint_ least16_ t - __
uint_ least32_ t - __
uint_ least64_ t - __
uintmax_ t - __
useconds_ t - int_
fast8_ t - int_
fast16_ t - int_
fast32_ t - int_
fast64_ t - int_
least8_ t - int_
least16_ t - int_
least32_ t - int_
least64_ t - intmax_
t - nix_err
- Type for error codes in the Nix system This type can have one of several predefined constants:
- nix_
get_ string_ callback - Called to get the value of a string owned by Nix.
The
startdata is borrowed and the function must not assume that the buffer persists after it returns. - nix_
verbosity - Verbosity level
- uint_
fast8_ t - uint_
fast16_ t - uint_
fast32_ t - uint_
fast64_ t - uint_
least8_ t - uint_
least16_ t - uint_
least32_ t - uint_
least64_ t - uintmax_
t - wchar_t