{ description = "WetGit - Nederlandse wetgeving als code"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; # Python 3.13 (zelfde versie als ansible gebruikt, voorkomt PATH-conflicten) pythonEnv = pkgs.python313.withPackages (ps: with ps; [ # Conversie-pipeline (PRD: Technische Stack) lxml # BWB XML-parsing met XPath/XSLT pygit2 # Git-operaties via libgit2 (performanter dan GitPython) pyyaml # YAML frontmatter generatie python-frontmatter # Markdown + YAML frontmatter parsing # API-laag (PRD: FastAPI) fastapi uvicorn # ASGI server httpx # Async HTTP client (SRU-API, EUR-Lex) pydantic # Data validatie # Achtergrondtaken (PRD: Celery + Redis) celery redis # Python Redis client # CLI-tool (PRD: wetgit CLI) click rich # Terminal formatting # Testing pytest pytest-cov pytest-asyncio # Development tools black ruff mypy pip setuptools wheel build # Typing stubs types-requests types-pyyaml ]); in { devShells.default = pkgs.mkShell { name = "wetgit"; buildInputs = with pkgs; [ # Python environment pythonEnv # Dependency management uv # Ansible (infrastructuur provisioning Hetzner) ansible ansible-lint # Hetzner Cloud CLI hcloud # Redis server (lokale development) redis # Git & tools git jq yq-go curl # Native dependencies voor pygit2 libgit2 ]; shellHook = '' echo "WetGit - Nederlandse wetgeving als code" echo "" echo "Python: $(python --version)" echo "Ansible: $(ansible --version 2>/dev/null | head -1)" echo "hcloud: $(hcloud version 2>/dev/null)" echo "" echo "Pipeline tools: lxml, pygit2, fastapi" echo "Infra tools: ansible, hcloud" echo "" # Laad .env als die bestaat (API keys, Hetzner token) if [ -f .env ]; then set -a source .env set +a echo "Loaded environment from .env" echo "" fi # Venv voor PyPI-only packages (agentmail etc.) if [ ! -d .venv ]; then uv venv .venv --python python3.13 --seed uv pip install --python .venv/bin/python agentmail echo "Created .venv and installed PyPI dependencies" fi source .venv/bin/activate ''; }; }); }