Nix 2.17.0
Nix, the purely functional package manager; stable external interfaces
Loading...
Searching...
No Matches
Settings

Functions

nix_err nix_setting_get (nix_c_context *context, const char *key, char *value, int n)
 Retrieves a setting from the nix global configuration. More...
 
nix_err nix_setting_set (nix_c_context *context, const char *key, const char *value)
 Sets a setting in the nix global configuration. More...
 

Detailed Description

Function Documentation

◆ nix_setting_get()

nix_err nix_setting_get ( nix_c_context context,
const char *  key,
char *  value,
int  n 
)

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.
[out]valueA pointer to a buffer where the value of the setting will be stored.
[in]nThe size of the buffer pointed to by value.
Returns
NIX_ERR_KEY if the setting is unknown, NIX_ERR_OVERFLOW if the provided buffer is too short, 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.