diff --git a/main/packages.nix b/main/packages.nix index 838c747..72a0caf 100644 --- a/main/packages.nix +++ b/main/packages.nix @@ -211,6 +211,8 @@ # news srv + + changedetection.io ]; in common; diff --git a/overlays/changedetection.io/default.nix b/overlays/changedetection.io/default.nix new file mode 100644 index 0000000..c222f28 --- /dev/null +++ b/overlays/changedetection.io/default.nix @@ -0,0 +1,63 @@ +{ lib, fetchFromGitHub, python3, substituteAll }: + +let + py = python3.override { + packageOverrides = self: super: { + timeago = super.buildPythonPackage rec { + pname = "timeago"; + version = "1.0.15"; + src = super.fetchPypi { + inherit version pname; + sha256 = "sha256-z85CDYKJKvayQ50Pae6z6Ha77dq2Zww8iOv3Z2QHv0w="; + }; + }; + inscriptis = super.buildPythonPackage rec { + pname = "inscriptis"; + version = "1.2"; + propagatedBuildInputs = with py.pkgs; [ lxml requests ]; + src = super.fetchPypi { + inherit version pname; + sha256 = "sha256-B2lFW/YwzCVdR8lwV9VGEW9HRfIii8u48Sy0wK+XeWY="; + }; + }; + }; + }; +in with py.pkgs; +buildPythonApplication rec { + pname = "changedetection.io"; + version = "0.30"; + + src = fetchFromGitHub { + owner = "dgtlmoon"; + repo = "changedetection.io"; + rev = "1d66160e8c9bd3cef8e1727fe66572f8b5065757"; + hash = "sha256-J0J6Jj9f2FD2aH4RWR1VnarX1vqnb5T6YmycxhzuyDw="; + }; + + patches = [ (substituteAll { src = ./setup.patch; }) ]; + + propagatedBuildInputs = with py.pkgs; [ + apprise + chardet + eventlet + feedgen + flask + flask_login + inscriptis + pytest + pytest-flask + pytz + requests + timeago + urllib3 + validators + ]; + + meta = with lib; { + description = + "changedetection.io - The best and simplest self-hosted website change detection monitoring service"; + homepage = "https://github.com/dgtlmoon/changedetection.io"; + license = licenses.asl20; + platforms = platforms.unix; + }; +} diff --git a/overlays/changedetection.io/setup.patch b/overlays/changedetection.io/setup.patch new file mode 100644 index 0000000..227aa49 --- /dev/null +++ b/overlays/changedetection.io/setup.patch @@ -0,0 +1,20 @@ +new file mode 100644 +index 0000000..e4db3d0 +--- /dev/null ++++ b/MANIFEST.in +@@ -0,0 +1 @@ ++recursive-include backend * +diff --git a/setup.py b/setup.py +new file mode 100644 +index 0000000..82bc34d +--- /dev/null ++++ b/setup.py +@@ -0,0 +1,8 @@ ++from setuptools import setup, find_packages ++ ++setup( ++ name="changedetection.io", ++ include_package_data=True, ++ packages=find_packages(), ++ scripts = [ './changedetection.py' ], ++) diff --git a/overlays/default.nix b/overlays/default.nix index 7e18f9b..6b28c82 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -5,5 +5,6 @@ final: prev: { rfd = prev.callPackage ./rfd { }; srv = prev.callPackage ./srv { }; vpngate = prev.callPackage ./vpngate { }; + changedetection.io = prev.callPackage ./changedetection.io { }; }