Flake nixConfig "warnings" obscure other warnings that are likely errors
Is your feature request related to a problem? Please describe.
Hi! This is a fairly minor one, but it's one that hurts a lot when it pops up:
slynux 2022-10-27 10:28:45 (0 sec)
/home/cole/code/nixcfg〉nix build '.#toplevels.openstick' --override-input mobile-nixos ~/
code/mobile-nixos/openstick
warning: Git tree '/home/cole/code/nixcfg' is dirty
warning: Using saved setting for 'experimental-features = nix-command flakes recursive-nix
' from ~/.local/share/nix/trusted-settings.json.
warning: Using saved setting for 'extra-substituters = https://cache.nixos.org https://col
emickens.cachix.org https://nixpkgs-wayland.cachix.org https://unmatched.cachix.org https:
//nix-community.cachix.org' from ~/.local/share/nix/trusted-settings.json.
warning: Using saved setting for 'extra-trusted-public-keys = cache.nixos.org-1:6NCHdD59X4
31o0gWypbMrAURkbJ16ZPMQFGspcDShjY= colemickens.cachix.org-1:bNrJ6FfMREB4bd4BOjEN85Niu8VcPd
Qe4F4KxVsb/I4= nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA= u
nmatched.cachix.org-1:F8TWIP/hA2808FDABsayBCFjrmrz296+5CQaysosTTc= nix-community.cachix.or
g-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=' from ~/.local/share/nix/trusted-settings
.json.
warning: input '' has an override for a non-existent input 'mobile-nixos'
warning: the flag '--override-input mobile-nixos git+file:///home/cole/code/mobile-nixos/o
penstick' does not match any input
trace: Building with crossSystem?: aarch64-linux != x86_64-linux → we are.
crossSystem: config: aarch64-unknown-linux-gnu
error: interrupted by the user
now, I see that block of warnings many, many times a day. I do understand that they're their to remind the user of what they've opted into, but it makes me sort of just ignore this big block of warnings that is common and unactionable.
But if you look really closely, there's actually two pretty important warnings:
warning: input '' has an override for a non-existent input 'mobile-nixos'
warning: the flag '--override-input mobile-nixos git+file:///home/cole/code/mobile-nixos/o
penstick' does not match any input
Describe the solution you'd like
-
Make specified, but ineffective (due to absence) input overrides fatal. It's hard to imagine a user specifying one at runtime and ... not expecting it to be utilized.
-
Figure out something to do with these big blocks of warnings that users become desensitized to. Maybe by simply demoting these ("don't forget you opted into these caches/keys") to INFO statements?
Given the existence of the warn-dirty setting in addition to allow-dirty in nix.conf, would it be possible to have a setting like warn-flake-config to match accept-flake-config, so we could choose to disable these warnings for saved settings when desired?
I get a lot of these messages in my CI. I'd be glad to implement something if we can decide on the next steps. Some thoughts for discussion before I put up any PRs:
Technically, this message isn't a warning. It is logged as an info. If we did introduce warn-flake-config, we'd probably want to make that a warning. Also, from the name it's not clear to me what warn-flake-config would cover. Would it cover just this error message? Or would it also cover things like "ignoring untrusted flake configuration setting"? Do we need granular controls?
~~It also seems a bit excessive that the default log level for nix is to log infos? I'd imagine warnings would be the default setting. Is this something that others would be open to changing?~~ Edit: I believe this isn't the case. It's actually something about my nix-fast-build setup that is causing nix to log infos by default.
Or, less of a breaking change, we could have a way of controlling the log level from nix.conf? I'm a bit surprised that this doesn't exist yet, but maybe I'm wrong? At least man nix.conf doesn't seem to have information on it...