{ lib, python3Packages, fetchFromGitHub, fetchPypi, }: let mkPy = { pname, version, src, propagatedBuildInputs ? [ ], meta ? { }, ... }@args: python3Packages.buildPythonPackage ({ inherit pname version src; pyproject = true; build-system = [ python3Packages.hatchling ]; inherit propagatedBuildInputs; doCheck = false; inherit meta; } // builtins.removeAttrs args [ "pname" "version" "src" "propagatedBuildInputs" "meta" "pyproject" "build-system" "doCheck" ]); fetchWheel = { pname, version, hash, propagatedBuildInputs ? [ ], meta ? { } }: python3Packages.buildPythonPackage { inherit pname version; format = "wheel"; src = fetchurl { url = "https://files.pythonhosted.org/packages/placeholder/${pname}-${version}-py3-none-any.whl"; inherit hash; }; inherit propagatedBuildInputs; doCheck = false; inherit meta; }; # ── 20 dependency packages ── pythonvcard4 = fetchWheel { pname = "pythonvcard4"; version = "0.2.0"; hash = lib.fakeHash; 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; 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; propagatedBuildInputs = with python3Packages; [ zipp ]; 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; 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; 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; 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; propagatedBuildInputs = with python3Packages; [ deprecated ]; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; 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; propagatedBuildInputs = with python3Packages; [ langchain-core ]; meta = with lib; { description = "LangChain text splitters"; homepage = "https://github.com/langchain-ai/langchain"; license = licenses.mit; }; }; in python3Packages.buildPythonApplication rec { pname = "nextcloud-mcp-server"; version = "0.89.0"; pyproject = true; src = fetchFromGitHub { owner = "cbcoutinho"; repo = "nextcloud-mcp-server"; rev = "v${version}"; hash = "sha256-IDTSGsHQ8cCFvgSO7pDbSSHVNV0OIjjoEN9ZfkaPAvk="; }; build-system = [ python3Packages.hatchling ]; dependencies = with python3Packages; [ mcp httpx pillow icalendar pydantic click caldav pyjwt aiosqlite alembic authlib fastembed anthropic boto3 starlette jinja2 markdownify pymupdf pymupdf4llm openai dynaconf mistralai sqlalchemy pythonvcard4 prometheus-client python-json-logger importlib-metadata googleapis-common-protos opentelemetry-api opentelemetry-proto opentelemetry-semantic-conventions opentelemetry-sdk x-wr-timezone opentelemetry-util-http opentelemetry-exporter-otlp-proto-common opentelemetry-instrumentation recurring-ical-events opentelemetry-exporter-otlp-proto-grpc qdrant-client opentelemetry-instrumentation-asgi opentelemetry-instrumentation-httpx opentelemetry-instrumentation-logging langchain-text-splitters ]; postPatch = '' substituteInPlace pyproject.toml \ --replace-fail '"prometheus-client>=0.21.0"' '"prometheus-client"' \ --replace-fail '"mcp>=1.27,<1.28"' '"mcp"' \ --replace-fail '"mcp[cli]>=1.27,<1.28"' '"mcp"' \ --replace-fail '"pymupdf4llm>=0.2.2"' '"pymupdf4llm"' \ --replace-fail '"pymupdf>=1.26.6"' '"pymupdf"' \ --replace-fail '"qdrant-client>=1.17.0"' '"qdrant-client"' \ --replace-fail '"opentelemetry-api>=1.28.2"' '"opentelemetry-api"' \ --replace-fail '"opentelemetry-sdk>=1.28.2"' '"opentelemetry-sdk"' \ --replace-fail '"opentelemetry-instrumentation-asgi>=0.49b2"' '"opentelemetry-instrumentation-asgi"' \ --replace-fail '"opentelemetry-instrumentation-httpx>=0.49b2"' '"opentelemetry-instrumentation-httpx"' \ --replace-fail '"opentelemetry-instrumentation-logging>=0.49b2"' '"opentelemetry-instrumentation-logging"' \ --replace-fail '"opentelemetry-exporter-otlp-proto-grpc>=1.28.2"' '"opentelemetry-exporter-otlp-proto-grpc"' \ --replace-fail '"python-json-logger>=3.2.0"' '"python-json-logger"' \ --replace-fail '"pythonvcard4>=0.2.0"' '"pythonvcard4"' ''; doCheck = false; meta = with lib; { description = "MCP server for Nextcloud — files, calendar, contacts, notes, deck, talk, sharing"; homepage = "https://github.com/cbcoutinho/nextcloud-mcp-server"; license = licenses.agpl3Only; mainProgram = "nextcloud-mcp-server"; platforms = platforms.all; }; }