treewide: improve readability of meta using "with lib;"#373548
treewide: improve readability of meta using "with lib;"#373548zeuner wants to merge 1 commit intoNixOS:masterfrom
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.