maralorn / nix-output-monitor

Pipe your nix-build output through the nix-output-monitor a.k.a nom to get additional information while building.
GNU Affero General Public License v3.0
809 stars 24 forks source link

Tab completion #31

Open mweinelt opened 2 years ago

mweinelt commented 2 years ago

The biggest regression from using plain nix is that we don't have tab completion anymore. Do we have someone who is familiar with that kind of thing to make nom-build feel more like a drop-in replacement for nix-build?

maralorn commented 2 years ago

I need to do more research to modify the nixpkgs expression to "just do the right thing".

Until then in zsh you can put compdef nom-build=nix-build in your zshrc.

SuperSandro2000 commented 2 years ago

For bash:

complete -F _nix_completion nom-build

I already started something https://github.com/hedning/nix-bash-completions/pull/16 but I can't remember if that fully worked or was half broken.

maralorn commented 2 years ago

As of https://github.com/NixOS/nixpkgs/pull/163441 we have zsh completion support in nixpkgs.

maralorn commented 2 years ago

For bash:

complete -F _nix_completion nom-build

I have just tried that command in a quick bash I started. That apparently didn’t work. Not sure what’s wrong.

SuperSandro2000 commented 2 years ago

I have just tried that command in a quick bash I started. That apparently didn’t work. Not sure what’s wrong.

Either bash-completion loads things async and you first need to load the nix completion function or my patch is really necessary. I have aliases nom to nix-build so everything just worked.

maralorn commented 2 years ago

With the new bunch of commands introduced now:

There is more todo on completion.