default.nix (1550B)
1 { 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 python312Packages, 6 replaceVars, 7 }: 8 9 python312Packages.buildPythonApplication rec { 10 pname = "mqttwarn"; 11 version = "0.35.0"; 12 pyproject = true; 13 14 src = fetchFromGitHub { 15 owner = "mqtt-tools"; 16 repo = "mqttwarn"; 17 tag = version; 18 hash = 19 if stdenv.hostPlatform.isDarwin then 20 "sha256-jdQNCmfGs1k52VKzcF132mmUSWkcdcsjx+AHxM+MRdw=" 21 else 22 "sha256-lr1cJvfQtkSc/DQc0fagAn5LQBgfVIwlUfxdbogcofM="; 23 }; 24 25 patches = [ 26 (replaceVars ./version.patch { 27 inherit version; 28 }) 29 ]; 30 31 build-system = with python312Packages; [ 32 setuptools 33 versioningit 34 ]; 35 36 dependencies = with python312Packages; [ 37 attrs 38 docopt 39 funcy 40 future 41 jinja2 42 paho-mqtt 43 requests 44 six 45 ]; 46 47 pythonRelaxDeps = true; 48 49 optional-dependencies = with python312Packages; { 50 apprise = [ apprise ]; 51 celery = [ celery ]; 52 chromecast = [ pychromecast ]; 53 dnsupdate = [ dnspython ]; 54 serial = [ pyserial ]; 55 ssh = [ paramiko ]; 56 tootpaste = [ mastodon-py ]; 57 websocket = [ websocket-client ]; 58 }; 59 60 doCheck = false; 61 62 nativeCheckInputs = [ 63 python312Packages.pytestCheckHook 64 ] ++ lib.flatten (lib.attrValues optional-dependencies); 65 66 meta = { 67 description = "A highly configurable MQTT message router, where the routing targets are notification plugins"; 68 homepage = "https://guthub.com/mqtt-tools/mqttwarn"; 69 license = lib.licenses.epl20; 70 maintainers = [ lib.maintainers.sikmir ]; 71 mainProgram = "mqttwarn"; 72 }; 73 }