Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tooltip about untracked files for nix3 commands #10394

Open
imadnyc opened this issue Apr 3, 2024 · 0 comments
Open

Add tooltip about untracked files for nix3 commands #10394

imadnyc opened this issue Apr 3, 2024 · 0 comments
Labels
feature Feature request or proposal

Comments

@imadnyc
Copy link

imadnyc commented Apr 3, 2024

As someone who switches between nix2 and nix3 commands often, I was annoyed when nix build .#geballs (a package that I had just written for nixpkgs and run in the nixpkgs root on my pc) didn't work but nix-build -A geballs did. The nix3 command didn't tell me that the working tree was dirty, because obviously git didn't know about it until I had staged it, so I kept getting the errors

error: flake 'git+file:///home/dre/Projects/nixpkgs' does not provide attribute 'packages.x86_64-linux.geball', 'legacyPackages.x86_64-linux.geball' or 'geball

It would be nice if there was a simple hint message along the lines of hint: did you stage your files? that always printed. I think that though this is semi-ugly to always display this everytime a flake doesn't find an attribute, I think that this is a nice stopgap until things like #6858 and #9352 get resolved. I think it'd be helpful for both beginners and people like me who forget.

It seems that all that would need to be done is add a string to here.

if (res.size() == 0)
throw Error(
suggestions,
"flake '%s' does not provide attribute %s",
flakeRef,
showAttrPaths(attrPaths));

This isn't a new suggestion by any means, but I think that it would be helpful if this got its own issue so discussion specific to just the tooltip can happen.

Priorities

Add 👍 to issues you find important.

@imadnyc imadnyc added the feature Feature request or proposal label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal
Projects
None yet
Development

No branches or pull requests

1 participant