1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-19 15:31:07 +01:00

Bring nix derivation show in compliance with JSON guidelines

This matches what we just did for `nix path-info`, and I hope will allow
us to avoiding any more breaking changes to this command for the
foreseeable future.
This commit is contained in:
John Ericson 2025-12-10 15:30:12 -05:00
parent 8b955d80c2
commit 0f18076f3a
9 changed files with 34 additions and 11 deletions

View file

@ -6,7 +6,7 @@ export NIX_TESTS_CA_BY_DEFAULT=1
drvPath=$(nix-instantiate ../simple.nix)
nix derivation show "$drvPath" | jq .[] > "$TEST_HOME"/simple.json
nix derivation show "$drvPath" | jq '.derivations[]' > "$TEST_HOME"/simple.json
drvPath2=$(nix derivation add < "$TEST_HOME"/simple.json)
@ -27,5 +27,5 @@ drvPath4=$(nix derivation add < "$TEST_HOME"/foo.json)
[[ -e "$drvPath3" ]]
# The modified derivation read back as JSON matches
nix derivation show "$drvPath3" | jq .[] > "$TEST_HOME"/foo-read.json
nix derivation show "$drvPath3" | jq '.derivations[]' > "$TEST_HOME"/foo-read.json
diff "$TEST_HOME"/foo.json "$TEST_HOME"/foo-read.json