Nixpkgs Architecture Team | 233 Members | |
| https://github.com/nixpkgs-architecture, weekly public meetings on Wednesday 15:00-16:00 UTC at https://meet.jit.si/nixpkgs-architecture | 52 Servers |
| Sender | Message | Time |
|---|---|---|
| 23 Jul 2022 | ||
| If by “metadata generation” you mean something like “generate license compliance documents”, that definitely feasible with nixpkgs, but I wouldn’t trust the metadata to be correct. In that case you have to actually unpack the source tarballs and search for the license in there. | 14:19:08 | |
| I think a good 80/20 solution for that could be possible and would be valuable (even as a product), but no idea whether that’s the use-case. | 14:19:50 | |
| (plus the tool that has the heuristics for finding license headers etc. is probably more work & value) | 14:20:33 | |
| Thanks this is what I needed to hear. Yeah what I before the overlays worked fine and was simple, in cases where you do you need to override you basically had to do it statically in specific files; but that's probably easier to grokk. Maintainability is a good point aa well. I know deep down these slick overlays are going to be hard for contributors to keep clean. | 17:07:59 | |
| And yeah I'll admit I got a sweet gig here haha. Pay is a bit lower than average, but they're cool with me running off to play with Nix for six months without pressing for deliverables 😁 | 17:11:34 | |
| With regards to the overrides/overlay question, I've had much more luck with the more limited (though less documented) scope concept. | 19:26:50 | |
| This was my take on `makeScope`. What hasn't clicked for me yet is how to nest multiple layers of scopes in a way that isn't painful. This is basically hacked together from `makeExtensible` and `makeScope` sources though : https://github.com/aameen-tulip/at-node-nix/blob/nps-scoped/lib/meta.nix#L184 | 20:14:31 | |
| I've also made like 3 attempts at a "recursive merge" that usually winds up "working... I think" but I have never had real confidence in them 😂 | 20:16:27 | |
| Im nesting 4 layers of those scopes for Nixpkgs Node Packages Node Package "outputs" Package Meta The two outer layers are effectively a `callPackage` style scope, while the inner two are fixed points that crawl metadata and form builders. | 20:19:10 | |
| One tricky part is I can't use packages as function args, so the fixed points are actually critical for topology | 20:20:14 | |
| The metadata crawling is where things are getting messy because you can collect some of the data from multiple sources. A priority module type thing would be "nice" but I know I'd be over-engineering | 20:22:03 | |
| Currently the That's one thing I was hoping to get guidance on honestly before I spend a couple of days chasing down that rabbit hole. | 20:36:38 | |
| * Currently the That's one thing I was hoping to get guidance on honestly before I spend a couple of days chasing down that rabbit hole. | 20:41:34 | |
In reply to @growpotkin1:matrix.org I've been iterating on a variant of this, called
where those libraries are available in the packages that need them and everything is automatically callPackage'd correctly. The end result is then only the packages referenced, not all of Nixpkgs, even though it can access it. It's like a recursiveCallPackageWith. The regular structure here also makes it easy to automatically create that entire call automatically by reading directories/files. | 21:30:42 | |
In reply to @growpotkin1:matrix.org* I've been iterating on a variant of this, called
where those libraries are available in the packages that need them and everything is automatically callPackage'd correctly. The end result is then only the packages referenced, not all of Nixpkgs, even though it can access it. It's like a recursiveCallPackageWith. The regular structure here also makes it easy to automatically create that entire call automatically by reading directories/files. | 21:43:20 | |
| Now that right there is nifty | 21:44:07 | |
| It seems (to me at least) easier to understand and use, but is strictly less powerful than overlay/overrides. | 21:44:21 | |
| Yeah that's pretty intuitive. It reminds me a little bit of `scopedImport` but presumably less ugly | 21:45:50 | |
| Scoped important was so close to being awesome. It's heartbreaking 😂 | 21:46:29 | |
| * Scoped import was so close to being awesome. It's heartbreaking 😂 | 21:46:37 | |
| This approach also goes along with the thought that these objects that are called with callPackage - i've used the term protoDerivations or blueprints - allow for easier composition and re-use than turning them into packages with makeOverridable and then trying to "overrideAttrs" your way to success. So i'd say that late-calling callPackage gives us easier UX. | 21:49:05 | |
| You got sources I can take for a spin? | 21:50:15 | |
| This sounds like my 3rd layer that generates builders from meta | 21:50:56 | |
| This is an example of building layers 2-4. The commented blocks use an older extension object and I'm still migrating them but you'll get the idea. https://github.com/aameen-tulip/at-node-nix/blob/nps-scoped/pkgs/node-pkg-set.nix | 21:53:14 | |
| not yet, but we do seem to be playing in a similar design space. Let me clean things up. Not sure if this is applicable to Nixpkgs design, but might help inform it. | 22:01:25 | |
| Yeah keep in touch. And of course, feel free to expropriate patterns from my libs 🙂 I think exploring this sort of thing may be good for test driving routines that can work their way into Nixpkgs after a bit of battle testing | 22:20:53 | |
| 26 Jul 2022 | ||
| Alright. My Frankenstein's monster is alive working with my over-engineered overlay system. I won't pretend that it's "a good model" as is; but it's able to back propagate changes to higher scopes, sort of like a module system does. Its probably misguided, but 🤷 | 02:10:39 | |
| Now if only I could understand "why my code works" I'd be golden | 02:14:15 | |
| https://github.com/aameen-tulip/at-node-nix/blob/nps-scoped/pkgs/node-pkg-set.nix You can feed it whatever node.js garbage you have laying around, and it should give you the same derivation without regard for what "method of input" you gave. This means if I use pkg A-1.0.0 in one lock or I pull it from a registry or I have a local copy or whatever - cache hits work. Oh, and I don't call NPM ever and Python only gets used when it's actually needed. Most derivations don't depend on Node even so you won't hog hydra. | 02:21:02 | |
| 27 Jul 2022 | ||
| I have to skip today's call, but I'll check the notes afterwards. | 14:44:35 | |