summaryrefslogtreecommitdiff
path: root/pkgs/mautrix-twitter/default.nix
diff options
context:
space:
mode:
authorParthiv Seetharaman <pachum99@myrdd.info>2022-01-16 21:29:21 -0800
committerParthiv Seetharaman <pachum99@myrdd.info>2022-01-16 21:44:42 -0800
commit8c05a809d70aeeb6c6e23d405ba693040ad00730 (patch)
tree70cc604e5eeb943e15c925f8e0c4d6d1eae8ed7c /pkgs/mautrix-twitter/default.nix
init the module, README, packages, and other stuff
Diffstat (limited to 'pkgs/mautrix-twitter/default.nix')
-rw-r--r--pkgs/mautrix-twitter/default.nix77
1 files changed, 77 insertions, 0 deletions
diff --git a/pkgs/mautrix-twitter/default.nix b/pkgs/mautrix-twitter/default.nix
new file mode 100644
index 0000000..be5385a
--- /dev/null
+++ b/pkgs/mautrix-twitter/default.nix
@@ -0,0 +1,77 @@
+{ stdenv
+, lib
+, python3
+, makeWrapper
+, fetchFromGitHub
+}:
+
+with python3.pkgs;
+
+let
+ # officially supported database drivers
+ dbDrivers = [
+ asyncpg
+ # sqlite driver is already shipped with python by default
+ ];
+
+in
+
+buildPythonApplication rec {
+ pname = "mautrix-twitter";
+ version = "unstable-2021-11-12";
+
+ src = fetchFromGitHub {
+ owner = "mautrix";
+ repo = "twitter";
+ rev = "deae0e10e6e376be2a0d02edcdc70965b46f05a7";
+ sha256 = "sha256-tATiqZlOIi+w6GTBdssv6+pvyHacZh+bDVH5kOrr0Js=";
+ };
+
+ postPatch = ''
+ sed -i -e '/alembic>/d' requirements.txt
+ '';
+ postFixup = ''
+ makeWrapper ${python}/bin/python $out/bin/mautrix-twitter \
+ --add-flags "-m mautrix_twitter" \
+ --prefix PYTHONPATH : "$(toPythonPath ${mautrix}):$(toPythonPath $out):$PYTHONPATH"
+ '';
+
+ propagatedBuildInputs = [
+ mautrix
+ yarl
+ aiohttp
+ aiosqlite
+ beautifulsoup4
+ sqlalchemy
+ CommonMark
+ ruamel_yaml
+ paho-mqtt
+ python_magic
+ attrs
+ pillow
+ qrcode
+ phonenumbers
+ pycryptodome
+ python-olm
+ unpaddedbase64
+ setuptools
+ ] ++ dbDrivers;
+
+ checkInputs = [
+ pytest
+ pytestrunner
+ pytest-mock
+ pytest-asyncio
+ ];
+
+ doCheck = false;
+
+ meta = with lib; {
+ homepage = "https://github.com/tulir/mautrix-twitter";
+ description = "A Matrix-Twitter DM puppeting bridge";
+ license = licenses.agpl3Plus;
+ platforms = platforms.linux;
+ };
+
+}
+