1{ python3
2, callPackage
3, recurseIntoAttrs
4, nixosTests
5, config
6}:
7
8# To expose the *srht modules, they have to be a python module so we use `buildPythonModule`
9# Then we expose them through all-packages.nix as an application through `toPythonApplication`
10# https://github.com/NixOS/nixpkgs/pull/54425#discussion_r250688781
11let
12 fetchNodeModules = callPackage ./fetchNodeModules.nix { };
13
14 python = python3.override {
15 packageOverrides = self: super: {
16 srht = self.callPackage ./core.nix { inherit fetchNodeModules; };
17
18 buildsrht = self.callPackage ./builds.nix { };
19 gitsrht = self.callPackage ./git.nix { };
20 hgsrht = self.callPackage ./hg.nix { };
21 hubsrht = self.callPackage ./hub.nix { };
22 listssrht = self.callPackage ./lists.nix { };
23 mansrht = self.callPackage ./man.nix { };
24 metasrht = self.callPackage ./meta.nix { };
25 pastesrht = self.callPackage ./paste.nix { };
26 todosrht = self.callPackage ./todo.nix { };
27
28 scmsrht = self.callPackage ./scm.nix { };
29 };
30 };
31in
32with python.pkgs; recurseIntoAttrs ({
33 inherit python;
34 coresrht = toPythonApplication srht;
35 buildsrht = toPythonApplication buildsrht;
36 gitsrht = toPythonApplication gitsrht;
37 hgsrht = toPythonApplication hgsrht;
38 hubsrht = toPythonApplication hubsrht;
39 listssrht = toPythonApplication listssrht;
40 mansrht = toPythonApplication mansrht;
41 metasrht = toPythonApplication metasrht;
42 pagessrht = callPackage ./pages.nix { };
43 pastesrht = toPythonApplication pastesrht;
44 todosrht = toPythonApplication todosrht;
45 passthru.tests = {
46 nixos-sourcehut = nixosTests.sourcehut;
47 };
48} // lib.optionalAttrs config.allowAliases {
49 # Added 2022-10-29
50 dispatchsrht = throw "dispatch is deprecated. See https://sourcehut.org/blog/2022-08-01-dispatch-deprecation-plans/ for more information.";
51})