about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/backup/tarsnapper/default.nix
blob: d793017ad873da59ef05505e122fd811084c0162 (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
{ lib
, python3Packages
, fetchFromGitHub
, tarsnap
}:

python3Packages.buildPythonApplication rec {
  pname = "tarsnapper";
  version = "0.4";

  src = fetchFromGitHub {
    owner = "miracle2k";
    repo = pname;
    rev = version;
    sha256 = "03db49188f4v1946c8mqqj30ah10x68hbg3a58js0syai32v12pm";
  };

  propagatedBuildInputs = with python3Packages; [
    pyyaml
    python-dateutil
    pexpect
  ];

  checkInputs = with python3Packages; [
    nose
  ];

  patches = [
    # Remove standard module argparse from requirements
    ./remove-argparse.patch
  ];

  makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ tarsnap ]}" ];

  checkPhase = ''
    runHook preCheck
    nosetests tests
    runHook postCheck
  '';

  pythonImportsCheck = [ "tarsnapper" ];

  meta = with lib; {
    description = "Wrapper which expires backups using a gfs-scheme";
    homepage = "https://github.com/miracle2k/tarsnapper";
    license = licenses.bsd2;
    maintainers = with maintainers; [ ];
  };
}