Usability Improvements

I typed in the following:


and I got an error that it wasn’t supported. Obviously I needed a capital ‘B’:


But the feedback from nixos-build switch was giving me no clue as to how wrong I got it. (E.g. was hardware.opengl known to it?)

The rust compiler would nicely suggest that maybe I meant X?

If nixos could suggest what I might have been after that would really improve the user experience.

Is someone working on this kind of a PR?


I’m not aware of anyone working on such a PR, but a couple things to note:

On NixOS, we have a tool nix-index that will make helpful suggestions if you try to run something that isn’t installed. For example:


You could perhaps implement something similar for NixOS module options that does some fuzzy searching. At the cmdline there’s nixos-option to expose the known system options, like this:


Some prior art that’s built in top of this and specifically setup for NixOS module options exists in emacs auto-complete and search plugins.

That can get you most of the way, though having the system itself tell you “I don’t know about X, but I know about similar option Y” would be nice!

1 Like

I have to say thank you very much for nix-index. It is indeed extremely helpful - I wondered how that magic happened. Yes that’s the kind of thing that makes a big difference.

I’m afraid I’ve turned to the dark side with respect to the emacs module.

1 Like