Skip to content

Make ValidPathInfo, NarInfo JSON instances, but don't yet use in the CLI#14503

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:store-info-transitional
Nov 11, 2025
Merged

Make ValidPathInfo, NarInfo JSON instances, but don't yet use in the CLI#14503
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:store-info-transitional

Conversation

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Nov 7, 2025

Motivation

Make instances for them that share code with nix path-info, but do a slightly different format without store paths containing store dirs (matching the other latest JSON formats).

Progress on #13570.

If we depend on the store dir, our JSON serializers/deserializers take extra arguements, and that interfaces with the likes of various frameworks for associating these with types (e.g. nlohmann in C++, Serde in Rust, and Aeson in Haskell).

Context

For now, nix path-info still uses the previous format, with store dirs. We may yet decide to "rip of the band-aid", and just switch it over, but that is left as a future PR.

depends on #14502


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@Ericson2314 Ericson2314 requested a review from edolstra as a code owner November 7, 2025 00:53
@github-actions github-actions bot added documentation new-cli Relating to the "nix" command labels Nov 7, 2025
@Ericson2314 Ericson2314 force-pushed the store-info-transitional branch from a076bf8 to 94712c1 Compare November 7, 2025 04:31
@github-actions github-actions bot added the with-tests Issues related to testing. PRs with tests have some priority label Nov 7, 2025
@dpulls
Copy link

dpulls bot commented Nov 10, 2025

🎉 All dependencies have been resolved !

@Ericson2314 Ericson2314 force-pushed the store-info-transitional branch from 94712c1 to 8858057 Compare November 10, 2025 23:25
…the CLI

Make instances for them that share code with `nix path-info`, but do a
slightly different format without store paths containing store dirs
(matching the other latest JSON formats).

Progress on NixOS#13570.

If we depend on the store dir, our JSON serializers/deserializers take
extra arguements, and that interfaces with the likes of various
frameworks for associating these with types (e.g. nlohmann in C++, Serde
in Rust, and Aeson in Haskell).

For now, `nix path-info` still uses the previous format, with store
dirs. We may yet decide to "rip of the band-aid", and just switch it
over, but that is left as a future PR.
@Ericson2314 Ericson2314 force-pushed the store-info-transitional branch from 8858057 to f5390e7 Compare November 10, 2025 23:31
Comment on lines +28 to +29
nlohmann::json toJSON(const StoreDirConfig * store, bool includeImpureInfo) const override;
static UnkeyedNarInfo fromJSON(const StoreDirConfig * store, const nlohmann::json & json);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably use a comment for the special semantics of nullptr. Otherwise sounds good.

@Ericson2314 Ericson2314 added this pull request to the merge queue Nov 11, 2025
Merged via the queue into NixOS:master with commit 295ad5c Nov 11, 2025
16 checks passed
@Ericson2314 Ericson2314 deleted the store-info-transitional branch November 11, 2025 01:04
@edolstra edolstra mentioned this pull request Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants