-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nix-instantiate --json
incorrectly uses store path
#5612
Comments
# my-file.nix
{ modulesPath, ... }:
{ imports = [(modulesPath + "/installer/scan/not-detected.nix")]; } nix/src/libexpr/value-to-xml.cc Lines 79 to 81 in 9cd8cff
nix/src/libexpr/value-to-json.cc Lines 34 to 36 in 9cd8cff
... but i have no idea why json should print store paths same for
|
Just ran into this, is there any reason the JSON printer behaves differently? I can't think of a reason to copy paths to the store when printing JSON. |
Makes `printValueAsJSON` not copy paths to the store for `nix eval --json`, `nix-instantiate --eval --json` and `nix-env --json`. Fixes NixOS#5612
This is now fixed for |
Makes `printValueAsJSON` not copy paths to the store for `nix eval --json`, `nix-instantiate --eval --json` and `nix-env --json`. Fixes NixOS#5612
Describe the bug
Inconsistent output for
nix-instantiate
between use of--json
,--xml
, and no encoding argument. In the case of--json
it uses the nix-store path.Steps To Reproduce
Set
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
inmy-file.nix
Observe the output for
Expected behavior
--json
output should be[ "/etc/nixos/nixpkgs/nixos/modules/installer/scan/not-detected.nix" ]
nix-env --version
outputnix-env (Nix) 2.4pre20211006_53e4794
The text was updated successfully, but these errors were encountered: