Skip to content

Have nix show-config show where value came from #11259

Open
@sellout

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.,

Priorities

Add 👍 to issues you find important.

Metadata

Assignees

No one assigned

    Labels

    featureFeature request or proposalsettingsSettings, global flags, nix.conf

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions