Help me understand scope so I can use pypi2nix requirements.nix again

Problem is that my requirements.nix from pypi2nix 2.0.4 somehow don’t work with Nix(OS) 21.03+ anymore. I am stuck with Generated code through pypi2nix is not usable anymore (pythonPackages change) · Issue #469 · nix-community/pypi2nix · GitHub. Figured out this changes in python part of nixpkgs are somehow related to cross-compilation, saw there is makeScope and makeScopeWithSplicing in https://github.com/NixOS/nixpkgs/blob/6b755ab26d6c7f217ff63e6994677b1485bef123/lib/customisation.nix but I have no idea how that is supposed to work. So it would be great if somebody could explain this stuff or point to some resources where I can learn more. Then maybe I would be able to manually fix the autogenerated requirements.nix (and possibly even submit a PR to pypi2nix). And yes I am aware of GitHub - DavHau/mach-nix: Create highly reproducible python environments but haven’t yet given it a try. In any case I want to understand things, not just switch the tools to make it “work”.

1 Like