about summary refs log tree commit diff
path: root/pkgs/servers/matrix-synapse/plugins/s3-storage-provider.nix
blob: 646dfc3728d12754961fa9bc8cecaac14067c5c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ lib, buildPythonPackage, fetchFromGitHub, matrix-synapse, twisted, humanize, boto3, tqdm }:

buildPythonPackage rec {
  pname = "matrix-synapse-s3-storage-provider";
  version = "1.2.1";

  src = fetchFromGitHub {
    owner = "matrix-org";
    repo = "synapse-s3-storage-provider";
    rev = "v${version}";
    sha256 = "sha256-92Xkq54jrUE2I9uVOxI72V9imLNU6K4JqDdOZb+4f+Y=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace "humanize>=0.5.1,<0.6" "humanize>=0.5.1"
  '';

  doCheck = false;
  pythonImportsCheck = [ "s3_storage_provider" ];

  buildInputs = [ matrix-synapse ];
  propagatedBuildInputs = [ twisted humanize boto3 tqdm ]
    # for the s3_media_upload script
    ++ matrix-synapse.propagatedBuildInputs;

  meta = with lib; {
    description = "Synapse storage provider to fetch and store media in Amazon S3";
    homepage = "https://github.com/matrix-org/synapse-s3-storage-provider";
    license = licenses.asl20;
    maintainers = with maintainers; [ yuka ];
  };
}