-
-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
doc: don't recommend listing packages with nix-env
#317392
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: wamirez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just seems silly to me. There's nothing wrong with using nix-env
in this way and the presented alternative is strictly worse?
Do we want to get people away from |
Listing packages given a (possibly nested) attrset while ignoring any eval errors is one of the only sensible uses of nix-env. What we want to get away from is using nix-env for imperative package management because it really sucks quite a lot at that. |
@Atemu would I be missing something crucial if I claim this can be done in the 4-liner I added as an example? |
Yes, it'd fall on its nose on the first attribute that doesn't eval or doesn't have a version. haskellPackages is quite well behaved in this regard but go I dare you to this on |
Incredible... just ignore assertions? https://github.com/NixOS/nix/blob/master/src/nix-env/nix-env.cc#L195 How about we all forget that code ever existed, merge this PR, and focus on something else? |
I don't have a strong opinion on this and I don't maintain this part of Nixpkgs. I also don't have anything more to contribute to this discussion, so I'm going to unsubscribe here. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-06-03-documentation-team-meeting-notes-131/46810/1 |
I have no strong opinion on this and I frankly don’t feel like arbitrating this on my free time. So I will just leave some thoughts: I empathize with the desire to get rid of references to nix-env. I mean in general even mentioning that packages won’t get listed by On the other hand the fact that this command becomes so much more complicated without it is annoying, eval errors will slip in from time to time and this usage of nix-env seems harmless in contrast to the usual critique of that command. I think the biggest advantage of having the listing in the manual is that it makes the package set a bit more graspable. My usual workflow is search.nixos.org or nix repl + tabcompletion, I don‘t know if that’s representative but if it is it might be the way to go also for the manual … |
You fundamentally have to do this when dealing with how nixpkgs works.
It's frankly bizarre to state that to list packages you should
instead of using a subcommand of
Yes, |
this removes the hard-coded listing, which can later be replaced by a dynamic one as for the Python interpreters
e337a2e
to
ff9e166
Compare
I like this in general. I still think that having a few example packages listed in the Haskell section makes it easier to quickly grasp the structure of the package sets in question. But overall this change is already an improvement. |
@maralorn I'd prefer to generate these examples automatically. For instance, we could list all compilers, and show a small subset of packages. As noted in the commit message, we have precedence with Python. It just needs time to sit down and get it into shape. |
Description of changes
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.