1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 14:21:48 +02:00

C API: (breaking) remove nix-flake-c global init

(cherry picked from commit 6a192ec0cd)
This commit is contained in:
Robert Hensing 2025-03-26 08:59:05 +00:00 committed by Mergify
parent 4642570e79
commit f07e4e27ce
12 changed files with 124 additions and 69 deletions

View file

@ -0,0 +1,20 @@
---
synopsis: C API `nix_flake_init_global` removed
prs: 12759
issues: 5638
---
In order to improve the modularity of the code base, we are removing a use of global state, and therefore the `nix_flake_init_global` function.
Instead, use `nix_flake_settings_add_to_eval_state_builder`. For example:
```diff
- nix_flake_init_global(ctx, settings);
- HANDLE_ERROR(ctx);
-
nix_eval_state_builder * builder = nix_eval_state_builder_new(ctx, store);
HANDLE_ERROR(ctx);
+ nix_flake_settings_add_to_eval_state_builder(ctx, settings, builder);
+ HANDLE_ERROR(ctx);
```