1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-11 19:41:04 +01:00
Commit graph

4 commits

Author SHA1 Message Date
John Ericson
f9089deb20 Make storeDir a part of UnkeyedValidPathInfo
The previous commit hacked it into the output of `nix path-info --json`,
this cleans that up my making it an actual field of that data type, and
part of the canonical JSON serializers for it (and `ValidPathInfo` and
`NarInfo`).

Beyond cleaning up the JSON code, this also opens the doors to things
like:

- Binary caches that contain store objects that don't all belong in the
  same store directory

- Relocatable store objects which carefully don't mention any store
  directory by absolute path, and instead use relative paths for
  anything. (#9549)
2025-12-03 23:20:06 -05:00
John Ericson
1ad13a1423 Introduce --json-format for nix path-info
As discussed today at great length in the Nix meeting, we don't want to
break the format, but we also don't want to impede the improvement of
JSON formats. The solution is to add a new flag for control the output
format.

Note that prior to the release, we may want to replace `--json
--json-format N` with `--json=N`, but this is being left for a separate
PR, as we don't yet have `=` support for CLI flags.
2025-12-03 22:04:21 -05:00
John Ericson
4f1c8f62c3 Futher cleans up store object info JSON v2
Since we haven't released v2 yet (2.32 has v1) we can just update this
in-place and avoid version churn.

Note that as a nice side effect of using the standard `Hash` JSON impl,
we don't neeed this `hashFormat` parameter anymore.
2025-11-06 23:28:56 -05:00
John Ericson
caa196e31d Make the store path info ca field structured in JSON
The old string format is a holdover from the pre JSON days. It is not
friendly to users who need to get the information out of it.

Also introduce the sort of versioning we have for derivation for this
format too.
2025-11-06 15:19:44 -05:00
Renamed from doc/manual/source/protocols/json/schema/store-object-info-v1.yaml (Browse further)