From c06b1086c0962a5909432c5b9590fc510926802a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 3 Jun 2021 23:41:07 +0200 Subject: [PATCH 1/2] python3Packages.click-option-group: init at 0.5.3 --- .../click-option-group/default.nix | 47 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/development/python-modules/click-option-group/default.nix diff --git a/pkgs/development/python-modules/click-option-group/default.nix b/pkgs/development/python-modules/click-option-group/default.nix new file mode 100644 index 000000000000..cf39ba808452 --- /dev/null +++ b/pkgs/development/python-modules/click-option-group/default.nix @@ -0,0 +1,47 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, click +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "click-option-group"; + version = "0.5.3"; + format = "setuptools"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "click-contrib"; + repo = pname; + rev = "v${version}"; + sha256 = "1w0692s8fabncpggpwl2d4dfqjjlmcia271rrb8hcz0r6nvw98ak"; + }; + + propagatedBuildInputs = [ + click + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "click_option_group" + ]; + + meta = with lib; { + description = "Option groups missing in Click"; + longDescription = '' + Option groups are convenient mechanism for logical structuring + CLI, also it allows you to set the specific behavior and set the + relationship among grouped options (mutually exclusive options + for example). Moreover, argparse stdlib package contains this + functionality out of the box. + ''; + homepage = "https://github.com/click-contrib/click-option-group"; + license = licenses.bsd3; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d3e35ec4cfac..d39487bf1ec7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1417,6 +1417,8 @@ in { click-log = callPackage ../development/python-modules/click-log { }; + click-option-group = callPackage ../development/python-modules/click-option-group { }; + click-plugins = callPackage ../development/python-modules/click-plugins { }; click-spinner = callPackage ../development/python-modules/click-spinner { }; From 7efe82966df83ed82938912c4ecdf705ed49be4a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 3 Jun 2021 23:58:49 +0200 Subject: [PATCH 2/2] matrix-synapse.tools.synadm: init at 0.29 --- pkgs/servers/matrix-synapse/tools/default.nix | 2 + pkgs/servers/matrix-synapse/tools/synadm.nix | 41 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 pkgs/servers/matrix-synapse/tools/synadm.nix diff --git a/pkgs/servers/matrix-synapse/tools/default.nix b/pkgs/servers/matrix-synapse/tools/default.nix index 43667f9e16de..defc35bc0e0a 100644 --- a/pkgs/servers/matrix-synapse/tools/default.nix +++ b/pkgs/servers/matrix-synapse/tools/default.nix @@ -1,4 +1,6 @@ { callPackage }: { rust-synapse-compress-state = callPackage ./rust-synapse-compress-state.nix { }; + + synadm = callPackage ./synadm.nix { }; } diff --git a/pkgs/servers/matrix-synapse/tools/synadm.nix b/pkgs/servers/matrix-synapse/tools/synadm.nix new file mode 100644 index 000000000000..b9a0ff3acd9a --- /dev/null +++ b/pkgs/servers/matrix-synapse/tools/synadm.nix @@ -0,0 +1,41 @@ +{ lib +, python3Packages +}: + +with python3Packages; buildPythonApplication rec { + pname = "synadm"; + version = "0.29"; + format = "setuptools"; + + src = fetchPypi { + inherit pname version; + sha256 = "1vy30nwsns4jnv0s5i9jpyplxpclgwyw0gldpywv4z3fljs0lzik"; + }; + + propagatedBuildInputs = [ + click + click-option-group + tabulate + pyyaml + requests + ]; + + checkPhase = '' + runHook preCheck + export HOME=$TMPDIR + $out/bin/synadm -h > /dev/null + runHook postCheck + ''; + + meta = with lib; { + description = "Command line admin tool for Synapse"; + longDescription = '' + A CLI tool to help admins of Matrix Synapse homeservers + conveniently issue commands available via its admin API's + (matrix-org/synapse@master/docs/admin_api) + ''; + homepage = "https://github.com/JOJ0/synadm"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ hexa ]; + }; +}