A way to disable warning about non-existent search path entry
Hope I'm filling the issue to the right tracker.
Is there a way to disable the annoying:
warning: Nix search path entry '/home/mark/.nix-defexpr/channels' does not exist, ignoring
Why:
- I'm on NixOS and I use root channel only. As I understand user channel defaults to that anyway.
- This thing is very annoying and screws some tools that parse output of other tools. For example
stackwith nix flag/setting will run/use nix under the hood and another tool that usually parses stack's output now chokes on this "warning" thing. That's just one example.
Like this:
$ stack path --dist-dir
warning: Nix search path entry '/home/mark/.nix-defexpr/channels' does not exist, ignoring
.stack-work/dist/x86_64-linux-nix/Cabal-2.0.1.0
Ask yourself, whether or not this warning should really be displayed every time some nix tool is run and just how inconvenient this is.
Would handling stderr differently than stdout help here? Haven't checked which we use when precisely but hopefully the part you don't want is on stderr?
Or is something reading stderr looking for errors/warnings/etc. but doesn't understand this one?
I think the code does not expect this sort of thing to be printed in stderr too, it only expects path. If this warning is absolutely necessary from your point of view, it would be great to at least have a way to disable it, it's so annoying and coveys zero useful information.
Nix's stderr is not intended to be parsed. I don't think we ever print anything with a specified format on stderr. Thus tools should not be confused by arbitrary diagnostic messages.
Having said that, I wouldn't mind removing this particular warning.
I marked this as stale due to inactivity. → More info
I closed this issue due to inactivity. → More info
related: #2982.
fyi, as a workaround i managed to use mkdir ~/.local/state/nix/profiles/channels.