about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/deepsecrets/default.nix
blob: c509311f3a6dea2249d9d2aa28ad652415aaef96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ lib
, python3
, fetchFromGitHub
}:

python3.pkgs.buildPythonApplication rec {
  pname = "deepsecrets";
  version = "1.0.6";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "avito-tech";
    repo = "deepsecrets";
    rev = "refs/tags/v${version}";
    hash = "sha256-VfIsPgStHcIYGbfrOs1mvgoq0ZoVSZwILFVBeMt/5Jc=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-warn 'pyyaml = "^5.4.1"' 'pyyaml = "*"' \
      --replace-warn 'regex = "^2023.3.23"' 'regex = "*"' \
      --replace-warn 'mmh3 = "^3.0.0"' 'mmh3 = "*"'
  '';

  nativeBuildInputs = with python3.pkgs; [
    poetry-core
  ];

  propagatedBuildInputs = with python3.pkgs; [
    dotwiz
    mmh3
    ordered-set
    pydantic_1
    pygments
    pyyaml
    regex
  ];

  pythonImportsCheck = [
    "deepsecrets"
  ];

  meta = with lib; {
    description = "Secrets scanner that understands code";
    homepage = "https://github.com/avito-tech/deepsecrets";
    changelog = "https://github.com/avito-tech/deepsecrets/releases/tag/v${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ fab ];
  };
}