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