diff options
Diffstat (limited to 'overlays/matrix-synapse/1.70.1/tools')
3 files changed, 83 insertions, 0 deletions
diff --git a/overlays/matrix-synapse/1.70.1/tools/default.nix b/overlays/matrix-synapse/1.70.1/tools/default.nix new file mode 100644 index 00000000..defc35bc --- /dev/null +++ b/overlays/matrix-synapse/1.70.1/tools/default.nix | |||
@@ -0,0 +1,6 @@ | |||
1 | { callPackage }: | ||
2 | { | ||
3 | rust-synapse-compress-state = callPackage ./rust-synapse-compress-state.nix { }; | ||
4 | |||
5 | synadm = callPackage ./synadm.nix { }; | ||
6 | } | ||
diff --git a/overlays/matrix-synapse/1.70.1/tools/rust-synapse-compress-state.nix b/overlays/matrix-synapse/1.70.1/tools/rust-synapse-compress-state.nix new file mode 100644 index 00000000..fcf123d6 --- /dev/null +++ b/overlays/matrix-synapse/1.70.1/tools/rust-synapse-compress-state.nix | |||
@@ -0,0 +1,30 @@ | |||
1 | { lib, rustPlatform, python3, fetchFromGitHub, pkg-config, openssl }: | ||
2 | |||
3 | rustPlatform.buildRustPackage rec { | ||
4 | pname = "rust-synapse-compress-state"; | ||
5 | version = "0.1.3"; | ||
6 | |||
7 | src = fetchFromGitHub { | ||
8 | owner = "matrix-org"; | ||
9 | repo = pname; | ||
10 | rev = "v${version}"; | ||
11 | sha256 = "sha256-SSfVtG8kwHarVbB1O7xC2SSbUpPGYMHTMyoxu8mpEk0="; | ||
12 | }; | ||
13 | |||
14 | cargoSha256 = "sha256-PG+UeovhJMsIlm5dOYdtMxbUxZjwG3V59kAcB9aFP5c="; | ||
15 | |||
16 | cargoBuildFlags = [ | ||
17 | "--all" | ||
18 | ]; | ||
19 | |||
20 | nativeBuildInputs = [ python3 pkg-config ]; | ||
21 | |||
22 | buildInputs = [ openssl ]; | ||
23 | |||
24 | meta = with lib; { | ||
25 | description = "A tool to compress some state in a Synapse instance's database"; | ||
26 | homepage = "https://github.com/matrix-org/rust-synapse-compress-state"; | ||
27 | license = licenses.asl20; | ||
28 | maintainers = with maintainers; [ hexa maralorn ]; | ||
29 | }; | ||
30 | } | ||
diff --git a/overlays/matrix-synapse/1.70.1/tools/synadm.nix b/overlays/matrix-synapse/1.70.1/tools/synadm.nix new file mode 100644 index 00000000..5075e42e --- /dev/null +++ b/overlays/matrix-synapse/1.70.1/tools/synadm.nix | |||
@@ -0,0 +1,47 @@ | |||
1 | { lib | ||
2 | , python3Packages | ||
3 | }: | ||
4 | |||
5 | with python3Packages; buildPythonApplication rec { | ||
6 | pname = "synadm"; | ||
7 | version = "0.36"; | ||
8 | format = "setuptools"; | ||
9 | |||
10 | src = fetchPypi { | ||
11 | inherit pname version; | ||
12 | sha256 = "sha256-OMXUbfAC927qJw0B5sq1lGJQRkFAUdohIOkCYUbZumI="; | ||
13 | }; | ||
14 | |||
15 | postPatch = '' | ||
16 | substituteInPlace setup.py \ | ||
17 | --replace "Click>=7.0,<8.0" "Click" | ||
18 | ''; | ||
19 | |||
20 | propagatedBuildInputs = [ | ||
21 | click | ||
22 | click-option-group | ||
23 | dnspython | ||
24 | tabulate | ||
25 | pyyaml | ||
26 | requests | ||
27 | ]; | ||
28 | |||
29 | checkPhase = '' | ||
30 | runHook preCheck | ||
31 | export HOME=$TMPDIR | ||
32 | $out/bin/synadm -h > /dev/null | ||
33 | runHook postCheck | ||
34 | ''; | ||
35 | |||
36 | meta = with lib; { | ||
37 | description = "Command line admin tool for Synapse"; | ||
38 | longDescription = '' | ||
39 | A CLI tool to help admins of Matrix Synapse homeservers | ||
40 | conveniently issue commands available via its admin API's | ||
41 | (matrix-org/synapse@master/docs/admin_api) | ||
42 | ''; | ||
43 | homepage = "https://github.com/JOJ0/synadm"; | ||
44 | license = licenses.gpl3Plus; | ||
45 | maintainers = with maintainers; [ hexa ]; | ||
46 | }; | ||
47 | } | ||