-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: allow extra args to be passed #16
base: main
Are you sure you want to change the base?
Conversation
Only saw this now, needs a rebase |
Still mulling a bit over this. Notice how the ./lib.nix is loaded with no inputs, so it can only deal with builtins. Maybe something like this would be better:
We're slowly converging towards a module system. |
Hi, is there anything in the way of merging this? I was just about to make a FR/PR for adding Honestly, given how conventional it is to have nixpkgs' lib as a module arg, I'd be inclined to include it by default to save everyone the boilerplate. That's just my 2 cents.
Wouldn't that be nice... |
I guess the main question is whether to add inputs to lib.nix and/or allow users to pass them in. Feel free to open another PR if you think you've got something that works :) |
This is a really interesting discussion; it seems simple on the surface but I think there's actually a ton of implication for the direction of a project like this. I arrived here thinking "I want access to these things. Why not give users access to these things?" The more I've thought about this question the more I think there's some very good reasons. Assumption: A primary goal of blueprint is to obviate boilerplate. This is accomplished by giving users convenient access to tools (so that they don't need boilerplate to make "missing" ones). Corollary: If you give users too many tools, the layer of abstraction breaks down, or they make a whole new layer of boilerplate on top. To the extent that users want something in order to write boilerplate, it ought not be made convenient. Instead, give users what they actually need (e.g. "to what end do they want inputs and extraArgs?") Bear in mind that folks can already modify extraArgs, pass inputs to libs, etc. without changes to blueprint. I'm doing it myself. It's just not convenient. In looking at my own usage of libs and extraArgs I realize they're all things that better serve users by upstreaming rather than fixing it for only myself:
Disclaimer: this is a strong opinion loosely held. Maybe it turns out that there are just some things that can't be better served by shared, higher-level tools. Maybe this turns out like overlays. I don't know for sure, but I've seen a lot of layers of abstraction break down and my current opinion is it's worth being more ... opinionated. |
tl;dr / concretely, my 2 cents:
|
Small revision: after playing around with it, it seems necessary & useful to have a ~ |
I tend to customise
nixpkgs.lib
in my projects using extensions. To accommodate this in a 'blueprint' style I've addedextraArgs
rather than trying to further customisenixpkgs
. This has the added benefit of accommodating wider use cases.