Home Explore Blog Models CI



nix

doc/manual/rl-next/derivation-json.md
f3246e4212110887a2ce39e17eea74e29e4f31bea548ca2100000003000002c9
---
synopsis: Derivation JSON format now uses store path basenames (no store dir) only
prs: [13980]
issues: [13570]
---

Experience with many JSON frameworks (e.g. nlohmann/json in C++, Serde
in Rust, and Aeson in Haskell), has show that the use of the store dir
in JSON formats is an impediment to systematic JSON formats, because it
requires the serializer/deserializer to take an extra paramater (the
store dir).

We ultimately want to rectify this issue with all (non-stable, able to
be changed) JSON formats. To start with, we are changing the JSON format
for derivations because the `nix derivation` commands are --- in
addition to being formally unstable --- less widely used than other
unstable commands.

Chunks
0440c045 (1st chunk of `doc/manual/rl-next/derivation-json.md`)
Title: Nix Derivation JSON Format Change: Removing Store Directory from Store Paths
Summary
This document announces a change to the JSON format for Nix derivations. Previously, the format included the store directory in store paths, which complicated serialization/deserialization across various JSON frameworks. To simplify the format and address this impedance, the new derivation JSON format will only use store path basenames, omitting the store directory. This change is being implemented first for derivations due to their formally unstable nature and less widespread usage compared to other unstable commands, with a long-term goal to apply this rectification to other changeable JSON formats.