Open
Description
Is your feature request related to a problem? Please describe.
I have run into multiple instances where I can’t easily align the output of nix show-config
with the contents of various nix.conf files on my system.
Describe the solution you'd like
I would like nix show-config
(perhaps only with a flag) to include an ordered list of the sources of the values (files, env vars, and command-line flags), e.g.,
/etc/nix/nix.conf:
substituters = https://cache.nixos.org/
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
~/.config/nix/nix.conf:
extra-substituters = https://cache.garnix.io
trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=
$ NIX_CONFIG="bash-prompt-prefix = nix>>" nix show-config
# from /etc/nix/nix.conf, ~/.config/nix/nix.conf
substituters = https://cache.nixos.org/ https://cache.garnix.io
# from ~/.config/nix/nix.conf
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
# from $NIX_CONFIG
bash-prompt-prefix = nix>>
(notice in the second case, that /etc/nix/nix.conf isn’t listed, since the ~/.config/nix/nix.conf entry overrode it)
Adding even more detail would be great, e.g.,
- keeping track of values from earlier sources that got overridden by later ones;
- illustrating cases like those caused by extra-* settings are order depedendent: extra-foo option is a noop if used before foo in the configuration file #9487, where there was an
extra-foo
beforefoo
in the same config, showing that it got overridden locally; - indicating that a file appended to the value without overriding it;
- etc.
Priorities
Add 👍 to issues you find important.