From 1bee4762c3336b2ae4c015a692e96ee89ef0d1e6 Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 1 Aug 2020 20:43:24 +0200 Subject: [PATCH] mautrix-telegram: add postgresql database driver PostgreSQL is listed as an officially supported database backend. --- pkgs/servers/mautrix-telegram/default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/mautrix-telegram/default.nix b/pkgs/servers/mautrix-telegram/default.nix index 8d5349dbf3665..c39d4fc0d861d 100644 --- a/pkgs/servers/mautrix-telegram/default.nix +++ b/pkgs/servers/mautrix-telegram/default.nix @@ -2,7 +2,14 @@ with python3.pkgs; -buildPythonPackage rec { +let + # officially supported database drivers + dbDrivers = [ + psycopg2 + # sqlite driver is already shipped with python by default + ]; + +in buildPythonPackage rec { pname = "mautrix-telegram"; version = "0.8.2"; disabled = pythonOlder "3.6"; @@ -32,7 +39,7 @@ buildPythonPackage rec { pillow lxml setuptools - ]; + ] ++ dbDrivers; # `alembic` (a database migration tool) is only needed for the initial setup, # and not needed during the actual runtime. However `alembic` requires `mautrix-telegram` @@ -41,7 +48,7 @@ buildPythonPackage rec { # Hence we need to patch away `alembic` from `mautrix-telegram` and create an `alembic` # which has `mautrix-telegram` in its environment. passthru.alembic = alembic.overrideAttrs (old: { - propagatedBuildInputs = old.propagatedBuildInputs ++ [ + propagatedBuildInputs = old.propagatedBuildInputs ++ dbDrivers ++ [ mautrix-telegram ]; });