Nix 2.28.3
Nix, the purely functional package manager: C API (experimental)
 
Loading...
Searching...
No Matches
Nix configuration settings

Functions

nix_err nix_setting_get (nix_c_context *context, const char *key, nix_get_string_callback callback, void *user_data)
 Retrieves a setting from the nix global configuration.
 
nix_err nix_setting_set (nix_c_context *context, const char *key, const char *value)
 Sets a setting in the nix global configuration.
 

Detailed Description

Function Documentation

◆ nix_setting_get()

nix_err nix_setting_get ( nix_c_context * context,
const char * key,
nix_get_string_callback callback,
void * user_data )

Retrieves a setting from the nix global configuration.

This function requires nix_libutil_init() to be called at least once prior to its use.

Parameters
[out]contextoptional, Stores error information
[in]keyThe key of the setting to retrieve.
[in]callbackCalled with the setting value.
[in]user_dataoptional, arbitrary data, passed to the callback when it's called.
See also
nix_get_string_callback
Returns
NIX_ERR_KEY if the setting is unknown, or NIX_OK if the setting was retrieved successfully.

◆ nix_setting_set()

nix_err nix_setting_set ( nix_c_context * context,
const char * key,
const char * value )

Sets a setting in the nix global configuration.

Use "extra-<setting name>" to append to the setting's value.

Settings only apply for new States. Call nix_plugins_init() when you are done with the settings to load any plugins.

Parameters
[out]contextoptional, Stores error information
[in]keyThe key of the setting to set.
[in]valueThe value to set for the setting.
Returns
NIX_ERR_KEY if the setting is unknown, or NIX_OK if the setting was set successfully.