Is your feature request related to a problem?
First class settings are a good start, but we don't currently have a way to load actual settings into them; whether that's from the environment, or setting individual settings.
Proposed solution
Add functions to
- load from the ambient environment
- set individual settings
This applies to all _settings objects. Perhaps we could add an explicit pointer upcast function from e.g. nix_flake_settings * to nix_abstract_settings *, so that these functions work for all types that have such a "cast". These should be non-failing functions so that users can easily write something like:
err = nix_settings_load(globalSettingsValues, nix_flake_settings_as_abstract_settings(flakeSettings));
They would not be expected to store these nix_abstract_settings * anywhere, and we don't provide downcasts. If they want runtime polymorphism, they could implement it themselves and do a better job using an existing polymorphism system, especially when the caller is a language binding.
Alternative solutions
Additional context
Checklist
Add 👍 to issues you find important.
Is your feature request related to a problem?
First class settings are a good start, but we don't currently have a way to load actual settings into them; whether that's from the environment, or setting individual settings.
Proposed solution
Add functions to
This applies to all
_settingsobjects. Perhaps we could add an explicit pointer upcast function from e.g.nix_flake_settings *tonix_abstract_settings *, so that these functions work for all types that have such a "cast". These should be non-failing functions so that users can easily write something like:They would not be expected to store these
nix_abstract_settings *anywhere, and we don't provide downcasts. If they want runtime polymorphism, they could implement it themselves and do a better job using an existing polymorphism system, especially when the caller is a language binding.Alternative solutions
Additional context
Checklist
Add 👍 to issues you find important.