|
| 1 | +--- |
| 2 | +synopsis: "JSON format changes for store path info and derivations" |
| 3 | +prs: [] |
| 4 | +issues: [] |
| 5 | +--- |
| 6 | + |
| 7 | +JSON formats for store path info and derivations have been updated with new versions and structured fields. |
| 8 | + |
| 9 | +## Store Path Info JSON (Version 2) |
| 10 | + |
| 11 | +The store path info JSON format has been updated from version 1 to version 2: |
| 12 | + |
| 13 | +- **Added `version` field**: |
| 14 | + |
| 15 | + All store path info JSON now includes `"version": 2`. |
| 16 | + |
| 17 | +- **Structured `ca` field**: |
| 18 | + |
| 19 | + Content address is now a structured JSON object instead of a string: |
| 20 | + |
| 21 | + - Old: `"ca": "fixed:r:sha256:1abc..."` |
| 22 | + - New: `"ca": {"method": "nar", "hash": {"algorithm": "sha256", "format": "base64", "hash": "EMIJ+giQ..."}}` |
| 23 | + - Still `null` values for input-addressed store objects |
| 24 | + |
| 25 | +Version 1 format is still accepted when reading for backward compatibility. |
| 26 | + |
| 27 | +**Affected command**: `nix path-info --json` |
| 28 | + |
| 29 | +## Derivation JSON (Version 4) |
| 30 | + |
| 31 | +The derivation JSON format has been updated from version 3 to version 4: |
| 32 | + |
| 33 | +- **Restructured inputs**: |
| 34 | + |
| 35 | + Inputs are now nested under an `inputs` object: |
| 36 | + |
| 37 | + - Old: `"inputSrcs": [...], "inputDrvs": {...}` |
| 38 | + - New: `"inputs": {"srcs": [...], "drvs": {...}}` |
| 39 | + |
| 40 | +- **Consistent content addresses**: |
| 41 | + |
| 42 | + Floating content-addressed outputs now use structured JSON format. |
| 43 | + This is the same format as `ca` in in store path info (after the new version). |
| 44 | + |
| 45 | +Version 3 and earlier formats are *not* accepted when reading. |
| 46 | + |
| 47 | +**Affected command**: `nix derivation`, namely it's `show` and `add` sub-commands. |
0 commit comments