From a08806da9a544d8d000b5fba748a456583a27f6f Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 27 May 2026 20:28:19 +0200 Subject: [PATCH] hybrid: 4 pypi wheels + 16 github sources --- packages/nextcloud-mcp-server/package.nix | 150 ++++++++++++++-------- 1 file changed, 93 insertions(+), 57 deletions(-) diff --git a/packages/nextcloud-mcp-server/package.nix b/packages/nextcloud-mcp-server/package.nix index b7ac100..7068530 100644 --- a/packages/nextcloud-mcp-server/package.nix +++ b/packages/nextcloud-mcp-server/package.nix @@ -6,112 +6,148 @@ }: let - fetchWheel = { pname, version, hash, propagatedBuildInputs ? [ ], meta ? { } }: + mkPy = { pname, version, hash, propagatedBuildInputs ? [ ], nativeBuildInputs ? [ ], src, meta ? { } }: python3Packages.buildPythonPackage { - inherit pname version; - format = "wheel"; - src = fetchPypi { - inherit pname version hash; - format = "wheel"; - dist = "py3"; - python = "py3"; - }; - inherit propagatedBuildInputs; + inherit pname version src; + pyproject = true; + build-system = [ python3Packages.hatchling ]; + inherit nativeBuildInputs propagatedBuildInputs; doCheck = false; inherit meta; }; - pythonvcard4 = fetchWheel { - pname = "pythonvcard4"; version = "0.2.0"; hash = lib.fakeHash; - meta = with lib; { description = "vCard parsing library"; homepage = "https://github.com/GNOME/python-vcard4"; license = licenses.gpl3Plus; }; + # ── 4 packages that work from PyPI ── + pythonvcard4 = python3Packages.buildPythonPackage { + pname = "pythonvcard4"; version = "0.2.0"; format = "wheel"; + src = fetchPypi { pname = "pythonvcard4"; version = "0.2.0"; hash = "sha256-3OMTVd1QruU3+Ig96G8wFRDkB7wXVaaOyNUFW2T1xmA="; format = "wheel"; dist = "py3"; python = "py3"; }; + doCheck = false; + meta = with lib; { description = "vCard parsing"; homepage = "https://github.com/GNOME/python-vcard4"; license = licenses.gpl3Plus; }; }; - prometheus-client = fetchWheel { - pname = "prometheus_client"; version = "0.25.0"; hash = lib.fakeHash; + prometheus-client = python3Packages.buildPythonPackage { + pname = "prometheus_client"; version = "0.25.0"; format = "wheel"; + src = fetchPypi { pname = "prometheus_client"; version = "0.25.0"; hash = "sha256-1a7InjSabsIwgF0N+ILzgH90/WwaL6hoZOPCJ5BZ/tE="; format = "wheel"; dist = "py3"; python = "py3"; }; + doCheck = false; meta = with lib; { description = "Prometheus client"; homepage = "https://github.com/prometheus/client_python"; license = licenses.asl20; }; }; - python-json-logger = fetchWheel { - pname = "python-json-logger"; version = "4.1.0"; hash = lib.fakeHash; - meta = with lib; { description = "JSON logger"; homepage = "https://github.com/nhairs/python-json-logger"; license = licenses.bsd2; }; - }; - importlib-metadata = fetchWheel { - pname = "importlib_metadata"; version = "8.7.1"; hash = lib.fakeHash; + importlib-metadata = python3Packages.buildPythonPackage { + pname = "importlib_metadata"; version = "8.7.1"; format = "wheel"; + src = fetchPypi { pname = "importlib_metadata"; version = "8.7.1"; hash = "sha256-Wh+Avx2qSJSVBx77sJXXWmNM8oqLwplYEkQGO1MXYVE="; format = "wheel"; dist = "py3"; python = "py3"; }; propagatedBuildInputs = with python3Packages; [ zipp ]; + doCheck = false; meta = with lib; { description = "Importlib metadata"; homepage = "https://github.com/python/importlib_metadata"; license = licenses.asl20; }; }; - googleapis-common-protos = fetchWheel { - pname = "googleapis-common-protos"; version = "1.75.0"; hash = lib.fakeHash; + x-wr-timezone = python3Packages.buildPythonPackage { + pname = "x_wr_timezone"; version = "2.0.1"; format = "wheel"; + src = fetchPypi { pname = "x_wr_timezone"; version = "2.0.1"; hash = "sha256-50pTufT33vgThFXCQOZeR8Ikd4vOPAJPzW2iy+kcoDg="; format = "wheel"; dist = "py3"; python = "py3"; }; + propagatedBuildInputs = with python3Packages; [ icalendar click ]; + doCheck = false; + meta = with lib; { description = "X-WR-TIMEZONE"; homepage = "https://github.com/niccokunzmann/x-wr-timezone"; license = licenses.lgpl3Plus; }; + }; + + # ── 16 packages from GitHub ── + python-json-logger = mkPy { + pname = "python-json-logger"; version = "4.1.0"; + src = fetchFromGitHub { owner = "nhairs"; repo = "python-json-logger"; rev = "v4.1.0"; hash = lib.fakeHash; }; + meta = with lib; { description = "JSON logger"; homepage = "https://github.com/nhairs/python-json-logger"; license = licenses.bsd2; }; + }; + googleapis-common-protos = mkPy { + pname = "googleapis-common-protos"; version = "1.75.0"; + src = fetchFromGitHub { owner = "googleapis"; repo = "python-api-common-protos"; rev = "v1.75.0"; hash = lib.fakeHash; }; propagatedBuildInputs = with python3Packages; [ protobuf ]; meta = with lib; { description = "Common protos"; homepage = "https://github.com/googleapis/python-api-common-protos"; license = licenses.asl20; }; }; - opentelemetry-api = fetchWheel { - pname = "opentelemetry-api"; version = "1.39.1"; hash = lib.fakeHash; + opentelemetry-api = mkPy { + pname = "opentelemetry-api"; version = "1.39.1"; + src = fetchFromGitHub { owner = "open-telemetry"; repo = "opentelemetry-python"; rev = "v1.39.1"; hash = lib.fakeHash; }; + sourceRoot = "source/opentelemetry-api"; propagatedBuildInputs = with python3Packages; [ deprecated ]; meta = with lib; { description = "OpenTelemetry API"; homepage = "https://github.com/open-telemetry/opentelemetry-python"; license = licenses.asl20; }; }; - opentelemetry-proto = fetchWheel { - pname = "opentelemetry-proto"; version = "1.39.1"; hash = lib.fakeHash; + opentelemetry-proto = mkPy { + pname = "opentelemetry-proto"; version = "1.39.1"; + src = fetchFromGitHub { owner = "open-telemetry"; repo = "opentelemetry-python"; rev = "v1.39.1"; hash = lib.fakeHash; }; + sourceRoot = "source/opentelemetry-proto"; propagatedBuildInputs = with python3Packages; [ protobuf ]; meta = with lib; { description = "OpenTelemetry Proto"; homepage = "https://github.com/open-telemetry/opentelemetry-python"; license = licenses.asl20; }; }; - opentelemetry-semantic-conventions = fetchWheel { - pname = "opentelemetry-semantic-conventions"; version = "0.60b1"; hash = lib.fakeHash; + opentelemetry-semantic-conventions = mkPy { + pname = "opentelemetry-semantic-conventions"; version = "0.60b1"; + src = fetchFromGitHub { owner = "open-telemetry"; repo = "semantic-conventions"; rev = "v0.60b1"; hash = lib.fakeHash; }; + sourceRoot = "source/model"; propagatedBuildInputs = with python3Packages; [ deprecated ]; - meta = with lib; { description = "OpenTelemetry semconv"; homepage = "https://github.com/open-telemetry/semantic-conventions"; license = licenses.asl20; }; + meta = with lib; { description = "OTel semconv"; homepage = "https://github.com/open-telemetry/semantic-conventions"; license = licenses.asl20; }; }; - opentelemetry-sdk = fetchWheel { - pname = "opentelemetry-sdk"; version = "1.39.1"; hash = lib.fakeHash; + opentelemetry-sdk = mkPy { + pname = "opentelemetry-sdk"; version = "1.39.1"; + src = fetchFromGitHub { owner = "open-telemetry"; repo = "opentelemetry-python"; rev = "v1.39.1"; hash = lib.fakeHash; }; + sourceRoot = "source/opentelemetry-sdk"; propagatedBuildInputs = with python3Packages; [ typing-extensions ]; meta = with lib; { description = "OpenTelemetry SDK"; homepage = "https://github.com/open-telemetry/opentelemetry-python"; license = licenses.asl20; }; }; - x-wr-timezone = fetchWheel { - pname = "x_wr_timezone"; version = "2.0.1"; hash = lib.fakeHash; - propagatedBuildInputs = with python3Packages; [ icalendar click ]; - meta = with lib; { description = "X-WR-TIMEZONE"; homepage = "https://github.com/niccokunzmann/x-wr-timezone"; license = licenses.lgpl3Plus; }; - }; - opentelemetry-util-http = fetchWheel { - pname = "opentelemetry-util-http"; version = "0.60b1"; hash = lib.fakeHash; + opentelemetry-util-http = mkPy { + pname = "opentelemetry-util-http"; version = "0.60b1"; + src = fetchFromGitHub { owner = "open-telemetry"; repo = "opentelemetry-python-contrib"; rev = "v0.60b1"; hash = lib.fakeHash; }; + sourceRoot = "source/util/opentelemetry-util-http"; meta = with lib; { description = "OTel HTTP utils"; homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib"; license = licenses.asl20; }; }; - opentelemetry-exporter-otlp-proto-common = fetchWheel { - pname = "opentelemetry-exporter-otlp-proto-common"; version = "1.39.1"; hash = lib.fakeHash; + opentelemetry-exporter-otlp-proto-common = mkPy { + pname = "opentelemetry-exporter-otlp-proto-common"; version = "1.39.1"; + src = fetchFromGitHub { owner = "open-telemetry"; repo = "opentelemetry-python"; rev = "v1.39.1"; hash = lib.fakeHash; }; + sourceRoot = "source/exporter/opentelemetry-exporter-otlp-proto-common"; meta = with lib; { description = "OTLP proto common"; homepage = "https://github.com/open-telemetry/opentelemetry-python"; license = licenses.asl20; }; }; - opentelemetry-instrumentation = fetchWheel { - pname = "opentelemetry-instrumentation"; version = "0.60b1"; hash = lib.fakeHash; + opentelemetry-instrumentation = mkPy { + pname = "opentelemetry-instrumentation"; version = "0.60b1"; + src = fetchFromGitHub { owner = "open-telemetry"; repo = "opentelemetry-python-contrib"; rev = "v0.60b1"; hash = lib.fakeHash; }; + sourceRoot = "source/opentelemetry-instrumentation"; propagatedBuildInputs = with python3Packages; [ wrapt packaging ]; meta = with lib; { description = "OTel instrumentation"; homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib"; license = licenses.asl20; }; }; - recurring-ical-events = fetchWheel { - pname = "recurring-ical-events"; version = "3.8.2"; hash = lib.fakeHash; + recurring-ical-events = mkPy { + pname = "recurring-ical-events"; version = "3.8.2"; + src = fetchFromGitHub { owner = "niccokunzmann"; repo = "python-recurring-ical-events"; rev = "v3.8.2"; hash = lib.fakeHash; }; propagatedBuildInputs = with python3Packages; [ icalendar python-dateutil ]; meta = with lib; { description = "Recurring iCal events"; homepage = "https://github.com/niccokunzmann/python-recurring-ical-events"; license = licenses.lgpl3Plus; }; }; - opentelemetry-exporter-otlp-proto-grpc = fetchWheel { - pname = "opentelemetry-exporter-otlp-proto-grpc"; version = "1.39.1"; hash = lib.fakeHash; + opentelemetry-exporter-otlp-proto-grpc = mkPy { + pname = "opentelemetry-exporter-otlp-proto-grpc"; version = "1.39.1"; + src = fetchFromGitHub { owner = "open-telemetry"; repo = "opentelemetry-python"; rev = "v1.39.1"; hash = lib.fakeHash; }; + sourceRoot = "source/exporter/opentelemetry-exporter-otlp-proto-grpc"; propagatedBuildInputs = with python3Packages; [ grpcio deprecated ]; meta = with lib; { description = "OTLP gRPC exporter"; homepage = "https://github.com/open-telemetry/opentelemetry-python"; license = licenses.asl20; }; }; - qdrant-client = fetchWheel { - pname = "qdrant-client"; version = "1.18.0"; hash = lib.fakeHash; + qdrant-client = mkPy { + pname = "qdrant-client"; version = "1.18.0"; + src = fetchFromGitHub { owner = "qdrant"; repo = "qdrant-client"; rev = "v1.18.0"; hash = lib.fakeHash; }; + nativeBuildInputs = [ python3Packages.poetry-core ]; propagatedBuildInputs = with python3Packages; [ grpcio httpx numpy portalocker protobuf pydantic urllib3 ]; meta = with lib; { description = "Qdrant client"; homepage = "https://github.com/qdrant/qdrant-client"; license = licenses.asl20; }; }; - opentelemetry-instrumentation-asgi = fetchWheel { - pname = "opentelemetry-instrumentation-asgi"; version = "0.60b1"; hash = lib.fakeHash; + opentelemetry-instrumentation-asgi = mkPy { + pname = "opentelemetry-instrumentation-asgi"; version = "0.60b1"; + src = fetchFromGitHub { owner = "open-telemetry"; repo = "opentelemetry-python-contrib"; rev = "v0.60b1"; hash = lib.fakeHash; }; + sourceRoot = "source/instrumentation/opentelemetry-instrumentation-asgi"; propagatedBuildInputs = with python3Packages; [ asgiref ]; meta = with lib; { description = "OTel ASGI"; homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib"; license = licenses.asl20; }; }; - opentelemetry-instrumentation-httpx = fetchWheel { - pname = "opentelemetry-instrumentation-httpx"; version = "0.60b1"; hash = lib.fakeHash; + opentelemetry-instrumentation-httpx = mkPy { + pname = "opentelemetry-instrumentation-httpx"; version = "0.60b1"; + src = fetchFromGitHub { owner = "open-telemetry"; repo = "opentelemetry-python-contrib"; rev = "v0.60b1"; hash = lib.fakeHash; }; + sourceRoot = "source/instrumentation/opentelemetry-instrumentation-httpx"; propagatedBuildInputs = with python3Packages; [ httpx wrapt ]; meta = with lib; { description = "OTel HTTPX"; homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib"; license = licenses.asl20; }; }; - opentelemetry-instrumentation-logging = fetchWheel { - pname = "opentelemetry-instrumentation-logging"; version = "0.60b1"; hash = lib.fakeHash; + opentelemetry-instrumentation-logging = mkPy { + pname = "opentelemetry-instrumentation-logging"; version = "0.60b1"; + src = fetchFromGitHub { owner = "open-telemetry"; repo = "opentelemetry-python-contrib"; rev = "v0.60b1"; hash = lib.fakeHash; }; + sourceRoot = "source/instrumentation/opentelemetry-instrumentation-logging"; meta = with lib; { description = "OTel logging"; homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib"; license = licenses.asl20; }; }; - langchain-text-splitters = fetchWheel { - pname = "langchain-text-splitters"; version = "1.1.2"; hash = lib.fakeHash; + langchain-text-splitters = mkPy { + pname = "langchain-text-splitters"; version = "1.1.2"; + src = fetchFromGitHub { owner = "langchain-ai"; repo = "langchain"; rev = "langchain-text-splitters==1.1.2"; hash = lib.fakeHash; }; + sourceRoot = "source/libs/text-splitters"; + nativeBuildInputs = [ python3Packages.poetry-core ]; propagatedBuildInputs = with python3Packages; [ langchain-core ]; meta = with lib; { description = "LangChain text splitters"; homepage = "https://github.com/langchain-ai/langchain"; license = licenses.mit; }; };