-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
treewide: improve readability of meta using "with lib;" #373548
base: master
Are you sure you want to change the base?
Conversation
#371665 goes for the removal of |
See #208242 for a bunch of discussion, #208242 (comment) for a general argument against (I personally dislike |
Hello, I'm surprised with this PR, we (the maintainers) are trying to get rid of It may improve readability (and I'm not sure of that, this is opinionated), but it may mess with any kind of static analysis tools the Nix language might have. So, I don't agree with this PR, at all. |
No intent to go against a consensus of writing |
This PR changes a lot of packages treewide where
meta
refers to lib to the formmeta = with lib; [...]
.This improves readability of the attr expression. Furthermore, in many PRs that add a package there is a review that asks for adding or removing
with lib;
from themeta
expression (I encountered both requests). It would be more efficient if there was one way to writemeta
on which we can all agree. There is https://nix.dev/guides/best-practices.html#with-scopes stating thatwith
scopes should not be used for large scopes.meta
could be considered a small scope, though.There is also the opposite done in #373573. Of course, it only makes sense to merge either this PR or the other one. I can live with either choice, but the codebase should reflect that choice (which is what this PR aims for), and it should be documented.
For now, I only consider
.nix
files that are already formatted withnixfmt
.Things done
meta
attr they touch unchanged.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.