I'm trying to replace a Python module (flask-limiter) by a completely different build script using callPackage in an overlay.
Based on the documentation for Python module overlays, I wrote the overlay like this:
final: prev:
rec {
python = prev.python.override {
packageOverrides = finalp: prevp: {
flask-limiter = prevp.callPackage ../flask-limiter.nix {
inherit (final.python.pkgs) buildPythonPackage pythonOlder typing-extensions asgiref flask hiro limits ordered-set pymemcache pymongo pytest-mock pytestCheckHook rich redis;
};
};
};
pythonPackages = python.pkgs;
flask-limiter = final.callPackage ../flask-limiter.nix {
inherit (final.python.pkgs) buildPythonPackage pythonOlder typing-extensions asgiref flask hiro limits ordered-set pymemcache pymongo pytest-mock pytestCheckHook rich redis;
};
}
(a build script to be ran being put at ../flask-limiter.nix)
The overlay and the build script do get evaluated, which can be seen because there is an error message when the inherit clause is missing some argument needed by the script. However, when I try to install it either directly or through a reverse dependency by nix-env -i, it always tries to install the package from nixpkgs, not my replacement from the overlay.
I tried to override python310 and python310Packages instead of python and pythonPackages, but it did not make a difference.