drv-parts icon indicating copy to clipboard operation
drv-parts copied to clipboard

Could we somehow import packages from nixpkgs?

Open DavHau opened this issue 2 years ago • 2 comments

I'm wondering if we could somehow import existing package definitions from nixpkgs. Maybe we could create another drv-parts backend that can wrap any default.nix file from nixpkgs. Then would make porting existing packages to drv-parts much easier.

DavHau avatar Dec 07 '22 01:12 DavHau

You could get at the internals fairly reliably with drv: (drv.overrideAttrs (self: super: { passthru.__expose = { inherit self super; }; })).__expose. That said, such a feature is going to break for corner cases and when Nixpkgs diverges from drv-parts. Maybe it's better than nothing?

roberth avatar Dec 09 '22 15:12 roberth

I've been hacking on the for the past two days until a point of frustration. The approach might just have been wrong. I opened a draft PR. Maybe you have some ideas.

DavHau avatar Dec 10 '22 09:12 DavHau