2022-09-14 18:05:37 +00:00
|
|
|
{ borgbackup, coreutils, lib, python3Packages, systemd, installShellFiles, borgmatic, testers }:
|
2021-03-12 07:09:13 +00:00
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "borgmatic";
|
2023-02-09 11:40:11 +00:00
|
|
|
version = "1.7.6";
|
2021-03-12 07:09:13 +00:00
|
|
|
|
|
|
|
src = python3Packages.fetchPypi {
|
|
|
|
inherit pname version;
|
2023-02-09 11:40:11 +00:00
|
|
|
sha256 = "sha256-TNh0laNAyHkIZLC51hzchSIDvsHst2aPxoRdI6Mdr84=";
|
2021-03-12 07:09:13 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = with python3Packages; [ flexmock pytestCheckHook pytest-cov ];
|
2021-03-12 07:09:13 +00:00
|
|
|
|
|
|
|
# - test_borgmatic_version_matches_news_version
|
|
|
|
# The file NEWS not available on the pypi source, and this test is useless
|
|
|
|
disabledTests = [
|
|
|
|
"test_borgmatic_version_matches_news_version"
|
|
|
|
];
|
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-03-12 07:09:13 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
borgbackup
|
|
|
|
colorama
|
2021-09-18 10:52:07 +00:00
|
|
|
jsonschema
|
2021-12-06 16:07:01 +00:00
|
|
|
ruamel-yaml
|
2021-03-12 07:09:13 +00:00
|
|
|
requests
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2022-09-14 18:05:37 +00:00
|
|
|
installShellCompletion --cmd borgmatic \
|
|
|
|
--bash <($out/bin/borgmatic --bash-completion)
|
|
|
|
|
2021-03-12 07:09:13 +00:00
|
|
|
mkdir -p $out/lib/systemd/system
|
|
|
|
cp sample/systemd/borgmatic.timer $out/lib/systemd/system/
|
|
|
|
substitute sample/systemd/borgmatic.service \
|
|
|
|
$out/lib/systemd/system/borgmatic.service \
|
|
|
|
--replace /root/.local/bin/borgmatic $out/bin/borgmatic \
|
|
|
|
--replace systemd-inhibit ${systemd}/bin/systemd-inhibit \
|
|
|
|
--replace sleep ${coreutils}/bin/sleep
|
|
|
|
'';
|
|
|
|
|
2022-09-14 18:05:37 +00:00
|
|
|
passthru.tests.version = testers.testVersion { package = borgmatic; };
|
|
|
|
|
2021-03-12 07:09:13 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Simple, configuration-driven backup software for servers and workstations";
|
|
|
|
homepage = "https://torsion.org/borgmatic/";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ imlonghao ];
|
|
|
|
};
|
|
|
|
}
|