| 8 Mar 2024 |
| @me:indeednotjames.com joined the room. | 19:40:34 |
@jade_:matrix.org | I just filed: https://github.com/NixOS/nixpkgs/pull/294353
In writing this I realized that we have both makeExtensible and makeScope. Is there any reason to use makeScope over makeExtensible? Have we written down somewhere secret which one to use in which cases? | 20:46:54 |
@jade_:matrix.org | Related question: in things like the nix packaging, what is the best practice for exposing internals like the boehmgc-nix package while avoiding unnecessarily confusing users with bonus attributes they probably don't care about? https://github.com/nixos/nixpkgs/blob/9080c3655bf8094f99c8c7cb548fd0ee75928260/pkgs/tools/package-management/nix/default.nix#L17-L162 | 20:49:33 |
@jade_:matrix.org | (specifically, I want to do a refactor where you can actually use the Nix common here from outside nixpkgs, which is currently not possible) | 20:50:11 |
infinisil | In reply to @jade_:matrix.org I just filed: https://github.com/NixOS/nixpkgs/pull/294353
In writing this I realized that we have both makeExtensible and makeScope. Is there any reason to use makeScope over makeExtensible? Have we written down somewhere secret which one to use in which cases? makeScope allows nested scopes to be created that somewhat compose | 20:50:29 |
infinisil | That said, I don't think makeExtensible has any benefit over makeScope | 20:50:51 |
Qyriad | there is also makeScopeWithSplicing, I definitely don't think there is documentation on which of the three to use in what cases | 20:51:03 |
@jade_:matrix.org | ^^^ this is something we really do need docs on | 20:51:25 |
infinisil | The splicing version works with cross compilation | 20:51:28 |
infinisil | Though it's super unintuitive to use 😅 | 20:51:44 |
@jade_:matrix.org | I think I have accidentally written the only public documentation on it in https://jade.fyi/blog/flakes-arent-real/ and I think the wiggles callPackage docs still didn't get picked out? can't recall. Anyway our whole callPackage and fixed points stuff really needs some better exposure and docs. | 20:52:33 |
infinisil | jade_: Very recent! https://github.com/NixOS/nix.dev/pull/935 | 20:53:06 |
@jade_:matrix.org | "how are packages composed together in nixpkgs at a higher level than mkDerivation" | 20:53:11 |
@jade_:matrix.org | In reply to @infinisil:matrix.org jade_: Very recent! https://github.com/NixOS/nix.dev/pull/935 ah, but there should be reference docs for that! | 20:53:21 |
infinisil | Yeah that too 😅 | 20:53:38 |
infinisil | I'll take any docs at this point! | 20:53:43 |
infinisil | jade_: Oh wait did you see https://github.com/NixOS/nixpkgs/pull/294194? | 20:54:24 |
@jade_:matrix.org | Part of the problem is that there is some NAT responsibility here, since it is in NAT purview which one should be used, and so that guidance falls on NAT, somewhat blocking the nixpkgs-dev-guide level docs | 20:54:50 |
@jade_:matrix.org | In reply to @infinisil:matrix.org jade_: Oh wait did you see https://github.com/NixOS/nixpkgs/pull/294194? omg recent! | 20:54:59 |
@jade_:matrix.org | i like that | 20:55:01 |
@jade_:matrix.org | I can file a bug if that's helpful | 20:55:34 |
infinisil | In reply to @jade_:matrix.org Part of the problem is that there is some NAT responsibility here, since it is in NAT purview which one should be used, and so that guidance falls on NAT, somewhat blocking the nixpkgs-dev-guide level docs My thoughts on that is that there's a delicate balance between actually fixing the root problems and getting side-tracked | 20:55:50 |
@jade_:matrix.org | yeah | 20:55:58 |
infinisil | (and makeScope and co seems like a side-track to me) | 20:56:14 |
@jade_:matrix.org | we do still have:
- busted ecosystem specific fixed points re mkDerivation
- busted ecosystem specific makeScope implementations and conventions
| 20:56:38 |
@jade_:matrix.org | https://github.com/nixpkgs-architecture/issues/issues/21 there is this already i suppose | 20:57:21 |
Qyriad | The Nix docs need to service people reading code as well as writing it, and if you're trying to figure out how Nixpkgs works — generally the only way to do that right now is by reading the source — you're going to encounter makeScope and friends, and they show up in a lot of critical places. | 20:57:37 |
Qyriad | A guide on using them correctly is not particularly urgent, I agree, but right they are now confusing, which is a state to escape from | 20:58:40 |
@jade_:matrix.org | I guess my issue with the writing of the docs is that there are multiple ways of doing it and I don't want to step on toes or reveal unknown-to-me consensus while doing it and have to rewrite what I'm doing heh. | 20:59:05 |
Qyriad | Self-fufilling prophecy 😔 | 20:59:36 |