{ 
  lib,
  python3Packages,
  hectic,
}:

let
  asyncio = python3Packages.buildPythonPackage rec {
    pname = "asyncio";
    version = "3.4.3";
    src = python3Packages.fetchPypi {
      inherit pname version;
      sha256 = "sha256-gzYP+LyXmA5P8lyWTHvTkj0zPRd6pPf7c2sBnybHy0E="; 
    };
  };
in
python3Packages.buildPythonPackage {
  pname = "photoedit-bot";
  version = "1.0";

  src = ./.;

  propagatedBuildInputs = (with python3Packages; [
    # Core dependencies from setup.py
    apscheduler
    requests
    aiogram
    aiosqlite
    quart
    quart-cors
    fastapi
    pillow
    uvicorn
    python-multipart
    hypercorn
    
    # Additional dependencies
    colorlog
    sqlite-utils
    pyjwt  # jwt package
  ]) ++ (with hectic; [
    py3-cryptomus
  ]) ++ [ asyncio ];

  pythonPath = [ "." ];

  # Copy data files
  postInstall = ''
    # Copy the font file
    cp Maler.ttf $out/lib/python*/site-packages/
    
    # Copy source_dir if it contains required files
    if [ -d source_dir ]; then
      cp -r source_dir $out/lib/python*/site-packages/
    fi
  '';

  meta = with lib; {
    description = "Photo editing Telegram bot";
    platforms = platforms.linux;
    maintainers = [ ];
  };
} 