Your snippet is adding a version of pyrate-limiter to environment.systemPackages, but probably your original problem was that a package was pulling in that package as a dependency, so all your snippet accomplishes is adding yet another version of pyrate-limiter to the closure of all packages to be installed (since the pkgs.ContainingPackage still pulls in it’s version of pyrate-limiter)
Probably easiest thing is
nixos-rebuild build --show-trace |& grep 'while evaluating derivation'
to try to inspect the tree of dependencies and see which package is pulling in pyrate-limiter. You might also be able to use nix-tree on your current system closure, but there are edge cases where this won’t work.
I see three main options, but others may know more.
- Option 1: remove that package from your
systemPackagesfor now, and use anix-shellwith pinned package in the meantime if you need that package. - Option 2: Pin the old version of whatever is referring to
pyrate-limiterand add that tosystemPackages. - Option 3: Otherwise you are in the realm of overlays. Conceptually this is what you were trying to do in your snippet, but it usually causes cache misses, requiring building instead of downloading pre-built packages. If you want a somewhat worked example of doing this for python dependencies, you can see it at Having trouble overriding python dependencies but I’d still think in most cases just using an older pinned version of the package that was pulling in
pyrate-limiterinstead is an easier method.