-
-
Notifications
You must be signed in to change notification settings - Fork 18k
treewide: improve readability of meta using "with lib;" #373548
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
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 |
|
Closing, because consensus is to remove |
|
@wolfgangwalther This is what this PR is doing, why closing it? |
No, it does the opposite. It adds |
|
Oh, I am so ashamed ! Sorry for the noise. |
This PR changes a lot of packages treewide where
metarefers 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 themetaexpression (I encountered both requests). It would be more efficient if there was one way to writemetaon which we can all agree. There is https://nix.dev/guides/best-practices.html#with-scopes stating thatwithscopes should not be used for large scopes.metacould 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
.nixfiles that are already formatted withnixfmt.Things done
metaattr they touch unchanged.nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-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.