8 encryptionSupport ? true,
13 python = python3.override {
15 packageOverrides = final: prev: {
17 # SQLAlchemy 2.0's derivation is very different, so don't override, just write it from scratch
18 # (see https://github.com/NixOS/nixpkgs/blob/65dbed73949e4c0207e75dcc7271b29f9e457670/pkgs/development/python-modules/sqlalchemy/default.nix)
19 sqlalchemy = final.buildPythonPackage rec {
24 inherit pname version;
25 sha256 = "sha256-67t3fL+TEjWbiXv4G6ANrg9ctp+6KhgmXcwYpvXvdRk=";
29 sed -e 's:--max-worker-restart=5::g' -i setup.cfg
32 # tests are pretty annoying to set up for this version, and these dependency overrides are already long enough
38 maubot = python.pkgs.buildPythonPackage rec {
41 disabled = python.pythonOlder "3.10";
44 inherit pname version;
45 hash = "sha256-PkeZ7C4Srs2I10g7X1XD/HclumUwWTYj2F3J2CxN4Hs=";
49 # add entry point - https://github.com/maubot/maubot/pull/146
51 url = "https://github.com/maubot/maubot/commit/ef6e23eccb530187dd3447b6aac2047d4a32fb83.patch";
52 hash = "sha256-d5fu47F93aXZmk6MiSsxTE8pHjMKNL0FUdU+ynUqY2o=";
56 propagatedBuildInputs =
60 (mautrix.override { withOlm = encryptionSupport; })
76 # optional-requirements.txt
77 ++ lib.optionals encryptionSupport [
82 ++ lib.optionals sqliteSupport [
86 # used for plugin tests
87 propagatedNativeBuildInputs = with python.pkgs; [
93 rm $out/example-config.yaml
96 # Setuptools is trying to do python -m maubot test
97 dontUseSetuptoolsCheck = true;
99 pythonImportsCheck = [
105 wrapper = callPackage ./wrapper.nix {
112 simple = runCommand "${pname}-tests" { } ''
113 ${maubot}/bin/mbc --help > $out
119 plugins = callPackage ./plugins {
124 withPythonPackages = pythonPackages: wrapper { inherit pythonPackages; };
126 # This adds the plugins to lib/maubot-plugins
127 withPlugins = plugins: wrapper { inherit plugins; };
129 # This changes example-config.yaml in module directory
130 withBaseConfig = baseConfig: wrapper { inherit baseConfig; };
134 description = "Plugin-based Matrix bot system written in Python";
135 homepage = "https://maubot.xyz/";
136 changelog = "https://github.com/maubot/maubot/blob/v${version}/CHANGELOG.md";
137 license = licenses.agpl3Plus;
138 # Presumably, people running "nix run nixpkgs#maubot" will want to run the tool
139 # for interacting with Maubot rather than Maubot itself, which should be used as
142 maintainers = with maintainers; [ chayleaf ];