Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 asgiref, 4 buildPythonPackage, 5 certifi, 6 charset-normalizer, 7 cvss, 8 deepl, 9 django, 10 fetchFromGitHub, 11 gql, 12 idna, 13 markdown-it-py, 14 mdurl, 15 pygments, 16 pytest, 17 pytestCheckHook, 18 pythonOlder, 19 pyyaml, 20 reptor, 21 requests, 22 rich, 23 setuptools, 24 sqlparse, 25 termcolor, 26 tomli, 27 tomli-w, 28 tomlkit, 29 urllib3, 30 xmltodict, 31}: 32 33buildPythonPackage rec { 34 pname = "reptor"; 35 version = "0.20"; 36 pyproject = true; 37 38 disabled = pythonOlder "3.8"; 39 40 src = fetchFromGitHub { 41 owner = "Syslifters"; 42 repo = "reptor"; 43 rev = "refs/tags/${version}"; 44 hash = "sha256-6DuIJScNiSaEez4vMRuA5Thr8zmvH0j3oiZmQhONSdY="; 45 }; 46 47 pythonRelaxDeps = true; 48 49 build-system = [ setuptools ]; 50 51 52 dependencies = [ 53 asgiref 54 certifi 55 charset-normalizer 56 cvss 57 django 58 idna 59 markdown-it-py 60 mdurl 61 pygments 62 pyyaml 63 requests 64 rich 65 sqlparse 66 termcolor 67 tomli 68 tomlkit 69 tomli-w 70 urllib3 71 xmltodict 72 ]; 73 74 passthru.optional-dependencies = { 75 ghostwriter = [ gql ] ++ gql.optional-dependencies.aiohttp; 76 translate = [ deepl ]; 77 }; 78 79 nativeCheckInputs = [ 80 pytestCheckHook 81 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); 82 83 preCheck = '' 84 export HOME=$(mktemp -d) 85 export PATH="$PATH:$out/bin"; 86 ''; 87 88 pythonImportsCheck = [ "reptor" ]; 89 90 disabledTestPaths = [ 91 # Tests want to use pip install dependencies 92 "reptor/plugins/importers/GhostWriter/tests/test_ghostwriter.py" 93 ]; 94 95 disabledTests = [ 96 # Tests need network access 97 "TestDummy" 98 "TestIntegration" 99 ]; 100 101 meta = with lib; { 102 description = "Module to do automated pentest reporting with SysReptor"; 103 mainProgram = "reptor"; 104 homepage = "https://github.com/Syslifters/reptor"; 105 changelog = "https://github.com/Syslifters/reptor/releases/tag/${version}"; 106 license = licenses.mit; 107 maintainers = with maintainers; [ fab ]; 108 }; 109}