1{ borgbackup, coreutils, lib, python3Packages, systemd }:
2
3python3Packages.buildPythonApplication rec {
4 pname = "borgmatic";
5 version = "1.5.18";
6
7 src = python3Packages.fetchPypi {
8 inherit pname version;
9 sha256 = "sha256-dX1U1zza8zMhDiTLE+DgtN6RLRciLks4NDOukpKH/po=";
10 };
11
12 checkInputs = with python3Packages; [ flexmock pytestCheckHook pytest-cov ];
13
14 # - test_borgmatic_version_matches_news_version
15 # The file NEWS not available on the pypi source, and this test is useless
16 disabledTests = [
17 "test_borgmatic_version_matches_news_version"
18 ];
19
20 propagatedBuildInputs = with python3Packages; [
21 borgbackup
22 colorama
23 jsonschema
24 ruamel-yaml
25 requests
26 setuptools
27 ];
28
29 postInstall = ''
30 mkdir -p $out/lib/systemd/system
31 cp sample/systemd/borgmatic.timer $out/lib/systemd/system/
32 substitute sample/systemd/borgmatic.service \
33 $out/lib/systemd/system/borgmatic.service \
34 --replace /root/.local/bin/borgmatic $out/bin/borgmatic \
35 --replace systemd-inhibit ${systemd}/bin/systemd-inhibit \
36 --replace sleep ${coreutils}/bin/sleep
37 '';
38
39 meta = with lib; {
40 description = "Simple, configuration-driven backup software for servers and workstations";
41 homepage = "https://torsion.org/borgmatic/";
42 license = licenses.gpl3Plus;
43 platforms = platforms.linux;
44 maintainers = with maintainers; [ imlonghao ];
45 };
46}