nix path-info --json output schema divergence from Nix #1100

Closed
opened 2026-01-09 09:02:38 +00:00 by mnixry · 1 comment

Describe the bug

Lix outputs a JSON array when running nix path-info --json. Upstream Nix (since approximately version 2.14) outputs a JSON object/dictionary keyed by the store path.

This schema mismatch breaks compatibility with external tooling and scripts written for modern Nix versions that expect Dict<StorePath, DerivationInfo>.

Steps To Reproduce

  1. Install Lix.

  2. Run a command like nix path-info --json nixpkgs#coreutils.

  3. Observe the output structure:

     [
       {
         "deriver": "/nix/store/x9sg4ch6n7z3flypyf5s305wgib7dd6f-coreutils-9.8.drv",
         "narHash": "sha256-B5apxHSZXXbJB8Y6W8879l1epngxT5ku7l7S+d5uI/I=",
         "narSize": 1631120,
         "path": "/nix/store/d75200gb22v7p0703h5jrkgg8bqydk5q-coreutils-9.8",
         "references": [
           "/nix/store/42hsdp2wh69pclsi2flbarql4fls0sm8-acl-2.3.2",
           "/nix/store/6lnqmp6z002x7i7if04a8y7y4v29pv2k-attr-2.5.2",
           "/nix/store/d75200gb22v7p0703h5jrkgg8bqydk5q-coreutils-9.8",
           "/nix/store/j193mfi0f921y0kfs8vjc1znnr45ispv-glibc-2.40-66",
           "/nix/store/ysybzx4slid45akig0q5b89afh32ar6k-gmp-with-cxx-6.3.0"
         ],
         "registrationTime": 1767550172,
         "signatures": [
           "cache.nixos.org-1:ojXJgSyMLcluDYXw4tVZNXrC4JEVn/qK0plegg1Gvvkrcg3qhNeUzU8PNXTlf8GonTZqPFa8bJ3arB12LmYODg=="
         ],
         "valid": true
       }
     ]
    
  4. Compare with upstream Nix output:

     {
       "/nix/store/d75200gb22v7p0703h5jrkgg8bqydk5q-coreutils-9.8": {
         "ca": null,
         "deriver": "/nix/store/x9sg4ch6n7z3flypyf5s305wgib7dd6f-coreutils-9.8.drv",
         "narHash": "sha256-B5apxHSZXXbJB8Y6W8879l1epngxT5ku7l7S+d5uI/I=",
         "narSize": 1631120,
         "references": [
           "/nix/store/42hsdp2wh69pclsi2flbarql4fls0sm8-acl-2.3.2",
           "/nix/store/6lnqmp6z002x7i7if04a8y7y4v29pv2k-attr-2.5.2",
           "/nix/store/d75200gb22v7p0703h5jrkgg8bqydk5q-coreutils-9.8",
           "/nix/store/j193mfi0f921y0kfs8vjc1znnr45ispv-glibc-2.40-66",
           "/nix/store/ysybzx4slid45akig0q5b89afh32ar6k-gmp-with-cxx-6.3.0"
         ],
         "registrationTime": 1767550172,
         "signatures": [
           "cache.nixos.org-1:ojXJgSyMLcluDYXw4tVZNXrC4JEVn/qK0plegg1Gvvkrcg3qhNeUzU8PNXTlf8GonTZqPFa8bJ3arB12LmYODg=="
         ],
         "ultimate": false
       }
     }
    

Expected behavior

Lix should output a JSON object keyed by the store path to match upstream behavior. The output should be Dict<str, DerivationInfo>, not Array<DerivationInfo>.

nix --version output

nix (Nix) 2.31.2+2

Additional context

This divergence stems from missing upstream commit cc46ea163024254d0b74646e1b38b19896d40040, which changed the output format. Lix appears to have dropped or missed this change, causing the API to drift for the last three years.

## Describe the bug Lix outputs a JSON array when running `nix path-info --json`. Upstream Nix (since approximately version 2.14) outputs a JSON object/dictionary keyed by the store path. This schema mismatch breaks compatibility with external tooling and scripts written for modern Nix versions that expect `Dict<StorePath, DerivationInfo>`. ## Steps To Reproduce 1. Install Lix. 2. Run a command like `nix path-info --json nixpkgs#coreutils`. 3. Observe the output structure: ```json [ { "deriver": "/nix/store/x9sg4ch6n7z3flypyf5s305wgib7dd6f-coreutils-9.8.drv", "narHash": "sha256-B5apxHSZXXbJB8Y6W8879l1epngxT5ku7l7S+d5uI/I=", "narSize": 1631120, "path": "/nix/store/d75200gb22v7p0703h5jrkgg8bqydk5q-coreutils-9.8", "references": [ "/nix/store/42hsdp2wh69pclsi2flbarql4fls0sm8-acl-2.3.2", "/nix/store/6lnqmp6z002x7i7if04a8y7y4v29pv2k-attr-2.5.2", "/nix/store/d75200gb22v7p0703h5jrkgg8bqydk5q-coreutils-9.8", "/nix/store/j193mfi0f921y0kfs8vjc1znnr45ispv-glibc-2.40-66", "/nix/store/ysybzx4slid45akig0q5b89afh32ar6k-gmp-with-cxx-6.3.0" ], "registrationTime": 1767550172, "signatures": [ "cache.nixos.org-1:ojXJgSyMLcluDYXw4tVZNXrC4JEVn/qK0plegg1Gvvkrcg3qhNeUzU8PNXTlf8GonTZqPFa8bJ3arB12LmYODg==" ], "valid": true } ] ``` 4. Compare with upstream Nix output: ```json { "/nix/store/d75200gb22v7p0703h5jrkgg8bqydk5q-coreutils-9.8": { "ca": null, "deriver": "/nix/store/x9sg4ch6n7z3flypyf5s305wgib7dd6f-coreutils-9.8.drv", "narHash": "sha256-B5apxHSZXXbJB8Y6W8879l1epngxT5ku7l7S+d5uI/I=", "narSize": 1631120, "references": [ "/nix/store/42hsdp2wh69pclsi2flbarql4fls0sm8-acl-2.3.2", "/nix/store/6lnqmp6z002x7i7if04a8y7y4v29pv2k-attr-2.5.2", "/nix/store/d75200gb22v7p0703h5jrkgg8bqydk5q-coreutils-9.8", "/nix/store/j193mfi0f921y0kfs8vjc1znnr45ispv-glibc-2.40-66", "/nix/store/ysybzx4slid45akig0q5b89afh32ar6k-gmp-with-cxx-6.3.0" ], "registrationTime": 1767550172, "signatures": [ "cache.nixos.org-1:ojXJgSyMLcluDYXw4tVZNXrC4JEVn/qK0plegg1Gvvkrcg3qhNeUzU8PNXTlf8GonTZqPFa8bJ3arB12LmYODg==" ], "ultimate": false } } ``` ## Expected behavior Lix should output a JSON object keyed by the store path to match upstream behavior. The output should be `Dict<str, DerivationInfo>`, not `Array<DerivationInfo>`. ## `nix --version` output nix (Nix) 2.31.2+2 ## Additional context This divergence stems from missing upstream commit [cc46ea163024254d0b74646e1b38b19896d40040](https://github.com/NixOS/nix/commit/cc46ea163024254d0b74646e1b38b19896d40040), which changed the output format. Lix appears to have dropped or missed this change, causing the API to drift for the last three years.
Owner

this is intentional. we never cherry-picked this change because it changed the output in a backwards-incompatible way that broke many CI systems, and we will not be changing the schema again before we have a way to request a specific, known version of the output (cf #901)

this is intentional. we never cherry-picked this change because it changed the output in a backwards-incompatible way that broke many CI systems, and we will not be changing the schema again before we have a way to request a specific, known version of the output (cf #901)
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1100
No description provided.