Unverified Commit 2cefe69f authored by Maximilian Bosch's avatar Maximilian Bosch
Browse files

mailmanPackages.python: allow changing python package-set used for mailman

When having a patch for a python module that should only be used for
mailman, but for nothing else, it's now possible to apply it like this:

    self: super: {
      mailmanPackages = super.mailmanPackages.extend (mailmanSelf: mailmanSuper: {
	python3 = mailmanSuper.python3.override {
	  overlay = pythonSelf: pythonSuper: {
	    psycopg2 = /* ... */;
	  };
	};
      });
    }

The underlying issue is that the `packageOverrides`-mechanism of
`pkgs.python3` doesn't compose, so an optional overlay is manually
applied to the `python3` used for mailman.
parent 892661f4
Loading
Loading
Loading
Loading
+18 −16
Original line number Diff line number Diff line
{ python3, fetchPypi }:
{ python3, lib, overlay ? (_: _: {}) }:

python3.override {
  packageOverrides = self: super: {
  packageOverrides = lib.composeExtensions
    (self: super: {
      # does not find tests
      alembic = super.alembic.overridePythonAttrs (oldAttrs: {
        doCheck = false;
      });
      # Fixes `AssertionError: database connection isn't set to UTC`
    psycopg2 = super.psycopg2.overridePythonAttrs (a: rec {
      psycopg2 = super.psycopg2.overridePythonAttrs (a: (rec {
        version = "2.8.6";
      src = fetchPypi {
        src = super.fetchPypi {
          inherit version;
          inherit (a) pname;
          sha256 = "fb23f6c71107c37fd667cb4ea363ddeb936b348bbd6449278eb92c189699f543";
        };
    });
  };
      }));
    })
    overlay;
}