summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/backup/unifi-protect-backup/default.nix
blob: 16169e98b1ff574ddbc1414101aaf3f16b301580 (plain)
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
{ fetchFromGitHub, python3, lib }:

python3.pkgs.buildPythonApplication rec {
  pname = "unifi-protect-backup";
  version = "0.8.8";

  format = "pyproject";

  src = fetchFromGitHub {
    owner = "ep1cman";
    repo = pname;
    rev = "refs/tags/v${version}";
    hash = "sha256-Z8qK7LprMyXl5irx9Xrs/RgqvNcFVBqLBSljovr6oiE=";
  };

  preBuild = ''
    sed -i 's_click = "8.0.1"_click = "^8"_' pyproject.toml
    sed -i 's_pyunifiprotect = .*_pyunifiprotect = "*"_' pyproject.toml
    sed -i 's_aiorun = .*_aiorun = "*"_' pyproject.toml
    sed -i '/pylint/d' pyproject.toml
  '';

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

  propagatedBuildInputs = with python3.pkgs; [
    aiocron
    aiorun
    aiosqlite
    click
    pyunifiprotect
  ];

  checkInputs = with python3.pkgs; [
    pytestCheckHook
  ];

  meta = with lib; {
    description = "Python tool to backup unifi event clips in realtime";
    homepage = "https://github.com/ep1cman/unifi-protect-backup";
    maintainers = with maintainers; [ ajs124 ];
    license = licenses.mit;
  };
}