14 Jan 2025 |
hellwolf | * https://github.com/NixOS/nixpkgs/pull/373563#discussion_r1914593287
I am not maintaining nixpkgs daily, could anyone help to explain this message to me? What made the "with" pattern undesirable and for when? | 10:40:50 |
Niklas Korz | In reply to @hellwolf:matrix.org https://github.com/NixOS/nixpkgs/pull/373563#discussion_r1914593287
I am not maintaining nixpkgs daily, could anyone help to explain this message to me? What made the "with" pattern undesirable and for when? it has the same downsides that using namespace std; has in C++, if that helps | 10:42:01 |
toonn | It's been considered undesirable for about 5 years now. It's very hard to track where names came from in its presence. | 10:42:11 |
Niklas Korz | it's ok to use if you e.g. only apply it to a directly following array, such as with lib.maintainers; [ ... ] | 10:42:52 |
Perchun Pak | with lib should be avoided, just with is fine | 10:43:01 |
hellwolf | alright folks. it's just that it's a lot of work for casual maintainers to keep up with this. I am interested in pushing this forward; but I totally feel it for people simply can't keep up and drop the balls. | 10:43:09 |
toonn | Might also affect evaluation performance negatively because of the size of the lookup it necessitates. | 10:43:21 |
hellwolf |
with lib should be avoided, just with is fine
You mean with lib.maintainers okay>
| 10:43:43 |
hellwolf | *
with lib should be avoided, just with is fine
You mean with lib.maintainers could be okay?
| 10:43:50 |
hellwolf | I think saying to avoid with lib is easier to digest | 10:44:01 |
Niklas Korz | In reply to @hellwolf:matrix.org alright folks. it's just that it's a lot of work for casual maintainers to keep up with this. I am interested in pushing this forward; but I totally feel it for people simply can't keep up and drop the balls. that's what reviews are for, it's not meant to be a personal attack but to raise awareness :) | 10:44:09 |
hellwolf | a linter for nixpkgs would be nice for maintainers | 10:44:13 |
toonn | A much nicer pattern IMO is `let inherit (set) value; in <body>`. | 10:44:17 |
hellwolf |
that's what reviews are for, it's not meant to be a personal attack but to raise awareness :)
No, not taking as personal attack. But it's a lot of churns.
| 10:44:31 |
hellwolf | Linter can help maintainer to get this right before putting it forward to people | 10:44:48 |
hellwolf | * A linter can help maintainer to get this right before putting it forward to people | 10:44:50 |
Niklas Korz | yeah on that I agree! is there an ongoing RFC for a nixpkgs linter? | 10:45:04 |
hellwolf | formatter is great, but linter has more roles | 10:45:20 |
Niklas Korz | also because such common things would then by catched by Github Actions | 10:45:25 |
hellwolf | * the current formatter is great, but linter has more roles | 10:45:26 |
Niklas Korz | * also because such common things would then be by catched by Github Actions | 10:45:34 |
Niklas Korz | * also because such common things would then be catched by Github Actions | 10:45:38 |
GaƩtan Lepage | I know that Lucas Eduardo is pretty interested in this topic. | 10:45:47 |
l1npengtul | Is there a way to symlink to the user's directory from a derivation? | 10:45:52 |
K900 | In reply to@l1npengtul:matrix.org Is there a way to symlink to the user's directory from a derivation? No | 10:46:32 |
K900 | Why> | 10:46:36 |
Niklas Korz | I'd also love stdenv.mkDerivation rec to be catched by a linter... | 10:46:37 |
K900 | * Why? | 10:46:37 |
@rnhmjoj:eurofusion.eu | In reply to @toonn:matrix.org A much nicer pattern IMO is `let inherit (set) value; in <body>`. for with lib; , but for with lib.maintainers it completely defeats the point | 10:46:42 |
l1npengtul | A binary application I'm dealing doesn't want to respect the HOME envvar. I'm assuming I have to make a FHS at this point. | 10:47:11 |