diff --git a/pkgs/servers/matrix-synapse/default.nix b/pkgs/servers/matrix-synapse/default.nix index 2370dbc94349d..0905276162579 100644 --- a/pkgs/servers/matrix-synapse/default.nix +++ b/pkgs/servers/matrix-synapse/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitHub +, fetchPypi , python3 , openssl , libiconv @@ -12,10 +13,24 @@ }: let - plugins = python3.pkgs.callPackage ./plugins { }; + python = python3.override { + packageOverrides = self: super: { + netaddr = super.netaddr.overridePythonAttrs (oldAttrs: rec { + version = "1.0.0"; + + src = fetchPypi { + pname = "netaddr"; + inherit version; + hash = "sha256-6wRrVTVOelv4AcBJAq6SO9aZGQJC2JsJnolvmycktNM="; + }; + }); + }; + }; + + plugins = python.pkgs.callPackage ./plugins { }; tools = callPackage ./tools { }; in -python3.pkgs.buildPythonApplication rec { +python.pkgs.buildPythonApplication rec { pname = "matrix-synapse"; version = "1.102.0"; format = "pyproject"; @@ -48,7 +63,7 @@ python3.pkgs.buildPythonApplication rec { sed -i 's/Pillow = ".*"/Pillow = ">=5.4.0"/' pyproject.toml ''; - nativeBuildInputs = with python3.pkgs; [ + nativeBuildInputs = with python.pkgs; [ poetry-core rustPlatform.cargoSetupHook setuptools-rust @@ -62,7 +77,7 @@ python3.pkgs.buildPythonApplication rec { libiconv ]; - propagatedBuildInputs = with python3.pkgs; [ + propagatedBuildInputs = with python.pkgs; [ attrs bcrypt bleach @@ -95,7 +110,7 @@ python3.pkgs.buildPythonApplication rec { ] ++ twisted.optional-dependencies.tls; - passthru.optional-dependencies = with python3.pkgs; { + passthru.optional-dependencies = with python.pkgs; { postgres = if isPyPy then [ psycopg2cffi ] else [ @@ -133,7 +148,7 @@ python3.pkgs.buildPythonApplication rec { nativeCheckInputs = [ openssl - ] ++ (with python3.pkgs; [ + ] ++ (with python.pkgs; [ mock parameterized ]) @@ -154,15 +169,14 @@ python3.pkgs.buildPythonApplication rec { NIX_BUILD_CORES=4 fi - PYTHONPATH=".:$PYTHONPATH" ${python3.interpreter} -m twisted.trial -j $NIX_BUILD_CORES tests + PYTHONPATH=".:$PYTHONPATH" ${python.interpreter} -m twisted.trial -j $NIX_BUILD_CORES tests runHook postCheck ''; passthru = { tests = { inherit (nixosTests) matrix-synapse matrix-synapse-workers; }; - inherit plugins tools; - python = python3; + inherit plugins tools python; }; meta = with lib; {