Overriding inputs to python packages

Is it possible to modify the inputs to a derivation made by callPackage in nixpkgs?

I would like to use a different implementation of mpi with mpi4py, but nixpkgs harcodes in openmpi (https://github.com/NixOS/nixpkgs/blob/1c7f02b0b9f115ccbc122ce39ae99debc1af857a/pkgs/top-level/python-packages.nix#L3798).

you can override the inputs to packages:

mpi4py.override {
  mpi = ...;

This can also be done in ~/.config/nixpkgs/config.nix as:

mpi4py = {
  mpi = ...;

Thanks so much! That’s exactly the answer I need.

1 Like