Files
lg-smtv-mcp/flake.nix
T
kiskaadee 7ea45c3d3b ci(nix): wire ruff and pyright into flake check and add Gitea Actions workflow
- flake.nix: add ruff and pyright to packages.default nativeCheckInputs and preCheck so nix build / nix flake check enforce lint, types, and pytest in the Nix sandbox
- .githooks/pre-commit: keep local pre-commit hook fast (<0.5s) running ruff, pyright, and pytest
- .gitea/workflows/ci.yaml: run nix flake check on push and pull_request to main
- AGENTS.md: document .githooks/pre-commit, @pytest.mark.xfail(strict=True) Red-phase rule, and .gitea/workflows/ci.yaml expectations
2026-11-15 12:21:01 -05:00

63 lines
1.4 KiB
Nix

{
description = "LG Smart TV (webOS) MCP server and testing environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
ps = pkgs.python3Packages;
runtimeDeps = [
ps.websockets
ps.mcp
ps.asyncssh
ps.uvicorn
];
testDeps = [
ps.httpx
ps.pytest
ps.pytest-asyncio
];
pythonEnv = pkgs.python3.withPackages (_: runtimeDeps ++ testDeps);
in
{
packages.${system}.default = ps.buildPythonApplication {
pname = "lg-smtv-mcp";
version = "0.1.0";
src = ./.;
pyproject = true;
build-system = [ ps.setuptools ];
dependencies = runtimeDeps;
nativeCheckInputs = [
ps.pytestCheckHook
pkgs.ruff
pkgs.pyright
] ++ testDeps;
preCheck = ''
ruff check .
pyright
'';
};
devShells.${system}.default = pkgs.mkShell {
packages = [
pythonEnv
pkgs.pyright
pkgs.ruff
];
shellHook = ''
export PYTHONPATH="$PWD/src:${PYTHONPATH:-}"
if [ -d .git ] && [ -d .githooks ]; then
git config core.hooksPath .githooks
fi
'';
};
};
}