Skip to content
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

Split out a package interface for non-single-drv packages #4

Closed
roberth opened this issue Dec 9, 2022 · 2 comments · Fixed by #17
Closed

Split out a package interface for non-single-drv packages #4

roberth opened this issue Dec 9, 2022 · 2 comments · Fixed by #17

Comments

@roberth
Copy link
Contributor

roberth commented Dec 9, 2022

Packages that aren't a single derivation are experimental, but enable new use cases.

@DavHau
Copy link
Owner

DavHau commented Feb 6, 2023

I'm currently browsing through the open issues trying to make a list of tasks to complete on drv-parts before starting to implement dream2nix: v1 API.

My main question here is: Can we make a multi-drv package interface that is useful to end users without having to change nix?

If I implement the multi-drv interface proposed in the linked nix issue, how would we make this compatible to the current nix which expects drvPath?

@roberth
Copy link
Contributor Author

roberth commented Feb 12, 2023

Can we make a multi-drv package interface that is useful to end users without having to change nix?

The linked issue is in part doubling down on the string context, which is already how expressions work in the language. drvPath is conceptually redundant because it's already part of the output strings contexts. Only the CLI boundary uses this shortcut and bad assumption.

Functions like lib.getBin and pkgs.buildEnv already work with output strings (always have, afaik), so users of expression-based systems like NixOS should not encounter any problems with such packages.

how would we make this compatible to the current nix which expects drvPath?

I suppose you could put a derivation that builds a link farm in drvPath. This way at least all the package outputs will continue to exist when queried as a single derivation. This behavior may still lead to surprises, so maybe there's a case to be made for pkg?drvPath == false, or drvPath = throw "This package consists of multiple outputs that are built by distinct derivations. It can't be understood as a single derivation. It's a package deal.";. Or maybe cut the end off that ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants