10 python3Packages.buildPythonApplication {
11 pname = "rspamd-trainer";
12 version = "unstable-2023-11-27";
15 src = fetchFromGitLab {
17 repo = "rspamd-trainer";
18 rev = "eb6639a78a019ade6781f3a8418eddc030f8fa14";
19 hash = "sha256-Me6WZhQ6SvDGGBQQtSA/7bIfKtsz6D5rvQeU12sVzgY=";
23 # Refactor pyproject.toml
24 # https://gitlab.com/onlime/rspamd-trainer/-/merge_requests/2
26 url = "https://gitlab.com/onlime/rspamd-trainer/-/commit/8824bfb9a9826988a90a401b8e51c20f5366ed70.patch";
27 hash = "sha256-qiXfwMUfM/iV+fHba8xdwQD92RQz627+HdUTgwgRZdc=";
28 name = "refactor_pyproject.patch";
33 # Fix module path not applied by patch
35 touch src/helper/__init__.py
36 mv settings.py src/rspamd_trainer/
37 sed -i 's/from settings/from .settings/' src/rspamd_trainer/run.py
40 sed -i "s|/usr/bin/rspamc|${rspamd}/bin/rspamc|" src/rspamd_trainer/run.py
43 nativeBuildInputs = with python3.pkgs; [
47 propagatedBuildInputs = with python3.pkgs; [
52 passthru.tests = { inherit (nixosTests) rspamd-trainer; };
55 homepage = "https://gitlab.com/onlime/rspamd-trainer";
56 description = "Grabs messages from a spam mailbox via IMAP and feeds them to Rspamd for training";
57 mainProgram = "rspamd-trainer";
58 license = lib.licenses.gpl3Only;
59 maintainers = with lib.maintainers; [ onny ];