summary refs log tree commit diff
path: root/pkgs/servers/mail
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2023-08-12 13:10:05 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2023-08-12 13:51:10 +0200
commit2cefe69f6f97b705fc49cdfb9bccca4d01280fa0 (patch)
treeb47125c8d466ed8eb1e724edb645ff692be95314 /pkgs/servers/mail
parent892661f45b57a188986a2f5518d163146b11fd9e (diff)
downloadnixpkgs-2cefe69f6f97b705fc49cdfb9bccca4d01280fa0.tar
nixpkgs-2cefe69f6f97b705fc49cdfb9bccca4d01280fa0.tar.gz
nixpkgs-2cefe69f6f97b705fc49cdfb9bccca4d01280fa0.tar.bz2
nixpkgs-2cefe69f6f97b705fc49cdfb9bccca4d01280fa0.tar.lz
nixpkgs-2cefe69f6f97b705fc49cdfb9bccca4d01280fa0.tar.xz
nixpkgs-2cefe69f6f97b705fc49cdfb9bccca4d01280fa0.tar.zst
nixpkgs-2cefe69f6f97b705fc49cdfb9bccca4d01280fa0.zip
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.
Diffstat (limited to 'pkgs/servers/mail')
-rw-r--r--pkgs/servers/mail/mailman/python.nix34
1 files changed, 18 insertions, 16 deletions
diff --git a/pkgs/servers/mail/mailman/python.nix b/pkgs/servers/mail/mailman/python.nix
index 288e48d814e..58256a961ab 100644
--- a/pkgs/servers/mail/mailman/python.nix
+++ b/pkgs/servers/mail/mailman/python.nix
@@ -1,19 +1,21 @@
-{ python3, fetchPypi }:
+{ python3, lib, overlay ? (_: _: {}) }:
 
 python3.override {
-  packageOverrides = 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 {
-      version = "2.8.6";
-      src = fetchPypi {
-        inherit version;
-        inherit (a) pname;
-        sha256 = "fb23f6c71107c37fd667cb4ea363ddeb936b348bbd6449278eb92c189699f543";
-      };
-    });
-  };
+  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 {
+        version = "2.8.6";
+        src = super.fetchPypi {
+          inherit version;
+          inherit (a) pname;
+          sha256 = "fb23f6c71107c37fd667cb4ea363ddeb936b348bbd6449278eb92c189699f543";
+        };
+      }));
+    })
+    overlay;
 }