1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00
nix/doc/manual/rl-next/deprecate__json.md
John Ericson 7577d2d3ae Deprecate hacky way of making structured attrs
The method tested for in the previous commit is now deprecated.

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2025-05-28 12:59:04 -04:00

11 lines
691 B
Markdown

---
synopsis: Deprecate manually making structured attrs with `__json = ...;`
prs: [13220]
---
The proper way to create a derivation using [structured attrs] in the Nix language is by using `__structuredAttrs = true` with [`builtins.derivation`].
However, by exploiting how structured attrs are implementated, it has also been possible to create them by setting the `__json` environment variable to a serialized JSON string.
This sneaky alternative method is now deprecated, and may be disallowed in future versions of Nix.
[structured attrs]: @docroot@/language/advanced-attributes.md#adv-attr-structuredAttrs
[`builtins.derivation`]: @docroot@/language/builtins.html#builtins-derivation