-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Impl: Propagate Flake inputs #6550
base: master
Are you sure you want to change the base?
Conversation
I've mixed feelings about that. I see the problem that it's solving, but I'm not entirely convinced by the solution. It would probably be useful for some use-cases like a multi-flakes repository, but would potentially be fairly confusing when used with external flakes ‑ because of the fact that it can or override the lockfile depending on whether the flake has an explicit input specification. Maybe restricting it to lockless flakes in a first time like you suggest in #6549 would be better until we can come up with a good solution. |
An attribute to explicitely ignore a potential existing lockfile might be an idea, although that's a big hammer for this kind of precise thing. And that wouldn't work really nicely with transitive flakes either 🤔 |
Can I vote against
? I think a lot of the use of this will be overriding locks in input flakes which are locked in a way you don't like. An attribute to ignore lock files would be nice indeed. A big hammer would do lots of jobs, though not all 😁 |
I agree with @charlesbaynham. I think restricting this to only lockless flakes leaves too little use for it. I dont know if it would even work for local subflakes as their inputs are eventually locked as well by the importing flake. I agree people may be surprised if the nixpkgs that is locked with their flake is incompatible with the propagated / registered one. However I think that's acceptable as long as we make clear that you need explicitly add a nixpkgs input to keep it. (works better if we'd call it propagate )
|
That's not really my fear. My issue on the contrary is that this creates an incentive for publishing “incomplete” flakes (in that their inputs won't be defined) since that would be the only way to have their input transparently overriden by a For example, if I'm the author of a public flake that is developped using That's why I thought about limiting this to lockless flakes since these have that implicit contract that… well, they aren't locked 🙃
Eventually they are, ofc, but afaik Nix distinguishes between a flake that's locked “by itself” and locked as part of the parent flake |
From discussion:
|
Well true, but if my flake is picky enough about its inputs that using the latest nixpkgs will break it then specifying "22.05" helps communicate that to the user. If, on the other hand, I'm pinning my dependencies out of good practice but I don't expect severe compatibility problems in the future, I use "nixpkgs" so that later users can override my locked version with theirs. |
FWIW, I agree with this sentiment, but my desired solution would be for the implementation to go even further by having In any case, something needs to be done here or there isn't much to do about #6626, assuming you do not have the authority to modify every upstream flake's input section without forking. Perhaps one way to have both behaviors would be to add another flag to |
It seems that Nix has to finally incur a lot of the language-level dependency management complexity. These probably aren't problems that are solved by single PRs, but rather by collecting requirements and designing a more comprehensive solution. Though it's just a thought. |
In the aforementioned spirit, I dropped this comment maybe in the wrong place: #6549 (comment) It is worth noting that the described goal is probably not feasible without static code analysis. Otoh, we have string contexts. Could we do identifier contexts that trace corresponding flake inputs reliably? |
MVP implementation of #6549