11 # To expose the *srht modules, they have to be a python module so we use `buildPythonModule`
12 # Then we expose them through all-packages.nix as an application through `toPythonApplication`
13 # https://github.com/NixOS/nixpkgs/pull/54425#discussion_r250688781
15 python = python3.override {
17 packageOverrides = self: super: {
18 srht = self.callPackage ./core.nix { };
20 buildsrht = self.callPackage ./builds.nix { };
21 gitsrht = self.callPackage ./git.nix { };
22 hgsrht = self.callPackage ./hg.nix { };
23 hubsrht = self.callPackage ./hub.nix { };
24 listssrht = self.callPackage ./lists.nix { };
25 mansrht = self.callPackage ./man.nix { };
26 metasrht = self.callPackage ./meta.nix { };
27 pastesrht = self.callPackage ./paste.nix { };
28 todosrht = self.callPackage ./todo.nix { };
30 scmsrht = self.callPackage ./scm.nix { };
32 # sourcehut is not (yet) compatible with SQLAlchemy 2.x
33 sqlalchemy = super.sqlalchemy_1_4;
35 # sourcehut is not (yet) compatible with flask-sqlalchemy 3.x
36 flask-sqlalchemy = super.flask-sqlalchemy.overridePythonAttrs (oldAttrs: rec {
38 format = "setuptools";
40 pname = "Flask-SQLAlchemy";
42 hash = "sha256-K9pEtD58rLFdTgX/PMH4vJeTbMRkYjQkECv8LDXpWRI=";
44 propagatedBuildInputs = with self; [
50 # flask-sqlalchemy 2.x requires flask 2.x
51 flask = super.flask.overridePythonAttrs (oldAttrs: rec {
54 inherit (oldAttrs) pname;
56 hash = "sha256-CcNHqSqn/0qOfzIGeV8w2CZlS684uHPQdEzVccpgnvw=";
60 # flask 2.x requires werkzeug 2.x
61 werkzeug = super.werkzeug.overridePythonAttrs (oldAttrs: rec {
64 inherit (oldAttrs) pname;
66 hash = "sha256-VUslfHS763oNJUFgpPj/4YUkP1KlIDUGC3Ycpi2XfwM=";
68 # Fixes a test failure with Pytest 8
69 patches = (oldAttrs.patches or []) ++ [
71 url = "https://github.com/pallets/werkzeug/commit/4e5bdca7f8227d10cae828f8064fb98190ace4aa.patch";
72 hash = "sha256-83doVvfdpymlAB0EbfrHmuoKE5B2LJbFq+AY2xGpnl4=";
77 # sourcehut is not (yet) compatible with factory-boy 3.x
78 factory-boy = super.factory-boy.overridePythonAttrs (oldAttrs: rec {
81 pname = "factory_boy";
83 hash = "sha256-+vSNYIoXNfDQo8nL9TbWT5EytUfa57pFLE2Zp56Eo3A=";
85 nativeCheckInputs = (with super; [
99 with python.pkgs; recurseIntoAttrs ({
101 coresrht = toPythonApplication srht;
102 buildsrht = toPythonApplication buildsrht;
103 gitsrht = toPythonApplication gitsrht;
104 hgsrht = toPythonApplication hgsrht;
105 hubsrht = toPythonApplication hubsrht;
106 listssrht = toPythonApplication listssrht;
107 mansrht = toPythonApplication mansrht;
108 metasrht = toPythonApplication metasrht;
109 pagessrht = callPackage ./pages.nix { };
110 pastesrht = toPythonApplication pastesrht;
111 todosrht = toPythonApplication todosrht;
113 nixos-sourcehut = nixosTests.sourcehut;
115 } // lib.optionalAttrs config.allowAliases {
117 dispatchsrht = throw "dispatch is deprecated. See https://sourcehut.org/blog/2022-08-01-dispatch-deprecation-plans/ for more information.";