From 577c915bd0cdae88b45018d3a952142f4d5e304b Mon Sep 17 00:00:00 2001 From: Amadej Kastelic Date: Tue, 13 Jan 2026 12:59:33 +0100 Subject: [PATCH] mcp-nixos: 1.0.3 -> 2.1.0 https://github.com/utensils/mcp-nixos/compare/v1.0.3..v2.1.0 --- pkgs/by-name/mc/mcp-nixos/package.nix | 27 +++++----------- .../mcp-nixos/tests-mock-nix-channels.patch | 32 ------------------- 2 files changed, 8 insertions(+), 51 deletions(-) delete mode 100644 pkgs/by-name/mc/mcp-nixos/tests-mock-nix-channels.patch diff --git a/pkgs/by-name/mc/mcp-nixos/package.nix b/pkgs/by-name/mc/mcp-nixos/package.nix index 4e93f0109204..345861f53f63 100644 --- a/pkgs/by-name/mc/mcp-nixos/package.nix +++ b/pkgs/by-name/mc/mcp-nixos/package.nix @@ -6,21 +6,16 @@ python3Packages.buildPythonApplication rec { pname = "mcp-nixos"; - version = "1.0.3"; + version = "2.1.0"; pyproject = true; src = fetchFromGitHub { owner = "utensils"; repo = "mcp-nixos"; tag = "v${version}"; - hash = "sha256-UCsJ8eDuHL14u2GFIYEY/drtZ6jht5zN/G/6QNlEy2g="; + hash = "sha256-rnpIDY/sy/uV+1dsW+MrFwAFE/RHg5K/6aa5k7Yt1Dc="; }; - patches = [ - # This patch mocks nix channel listing network calls in tests - ./tests-mock-nix-channels.patch - ]; - build-system = [ python3Packages.hatchling ]; dependencies = with python3Packages; [ @@ -30,8 +25,6 @@ python3Packages.buildPythonApplication rec { requests ]; - pythonRelaxDeps = [ "fastmcp" ]; - nativeCheckInputs = with python3Packages; [ anthropic pytestCheckHook @@ -39,18 +32,14 @@ python3Packages.buildPythonApplication rec { python-dotenv ]; - disabledTestMarks = [ - # Require network access - "integration" + disabledTestPaths = [ + # Requires network access + "tests/test_integration.py" ]; - disabledTestPaths = [ - # Require network access - "tests/test_nixhub.py" - "tests/test_mcp_behavior.py" - "tests/test_options.py" - # Requires configured channels - "tests/test_channels.py" + disabledTests = [ + # Requires network access + "test_valid_channel" ]; pythonImportsCheck = [ "mcp_nixos" ]; diff --git a/pkgs/by-name/mc/mcp-nixos/tests-mock-nix-channels.patch b/pkgs/by-name/mc/mcp-nixos/tests-mock-nix-channels.patch deleted file mode 100644 index 0aca953007cf..000000000000 --- a/pkgs/by-name/mc/mcp-nixos/tests-mock-nix-channels.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/tests/conftest.py b/tests/conftest.py -index baae124..2b4bf01 100644 ---- a/tests/conftest.py -+++ b/tests/conftest.py -@@ -1,6 +1,27 @@ - """Minimal test configuration for refactored MCP-NixOS.""" - - -+import pytest -+@pytest.fixture(autouse=True) -+def mock_get_channels(monkeypatch): -+ """Mock get_channels function to return fixed channels for all tests.""" -+ def mock_channels(): -+ return { -+ "unstable": "latest-43-nixos-unstable", -+ "25.05": "latest-43-nixos-25.05", -+ "25.11": "latest-43-nixos-25.11", -+ "24.11": "latest-43-nixos-24.11", -+ "stable": "latest-43-nixos-25.05", -+ "beta": "latest-43-nixos-25.05" -+ } -+ -+ # Patch the function in the server module -+ monkeypatch.setattr('mcp_nixos.server.get_channels', mock_channels) -+ -+ # Also patch any imported references in test modules -+ monkeypatch.setattr('tests.test_server.get_channels', mock_channels) -+ -+ - def pytest_addoption(parser): - """Add test filtering options.""" - parser.addoption("--unit", action="store_true", help="Run unit tests only")