2020-10-19 09:53:12 +00:00
|
|
|
|
{ stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, makeWrapper
|
2020-07-18 16:06:22 +00:00
|
|
|
|
, nixosTests, rclone }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2020-10-19 09:53:12 +00:00
|
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
pname = "restic";
|
2023-01-20 10:41:00 +00:00
|
|
|
|
version = "0.15.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "restic";
|
|
|
|
|
repo = "restic";
|
|
|
|
|
rev = "v${version}";
|
2023-01-20 10:41:00 +00:00
|
|
|
|
hash = "sha256-qWVmsW16eQM7d+HoHR2qE7GpcC5HK7TIhhx6J2glKpA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
|
patches = [
|
|
|
|
|
# The TestRestoreWithPermissionFailure test fails in Nix’s build sandbox
|
|
|
|
|
./0001-Skip-testing-restore-with-permission-failure.patch
|
|
|
|
|
];
|
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
|
vendorHash = "sha256-zhLFMvp97mQclaLwH4Hl8jFNMmoYrf8AtVv49RDq7lM=";
|
2020-10-19 09:53:12 +00:00
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
|
subPackages = [ "cmd/restic" ];
|
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
2020-05-03 17:38:23 +00:00
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
passthru.tests.restic = nixosTests.restic;
|
|
|
|
|
|
2020-10-19 09:53:12 +00:00
|
|
|
|
postPatch = ''
|
|
|
|
|
rm cmd/restic/integration_fuse_test.go
|
|
|
|
|
'';
|
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
|
postInstall = ''
|
|
|
|
|
wrapProgram $out/bin/restic --prefix PATH : '${rclone}/bin'
|
|
|
|
|
'' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
2020-05-15 21:57:56 +00:00
|
|
|
|
$out/bin/restic generate \
|
2020-05-03 17:38:23 +00:00
|
|
|
|
--bash-completion restic.bash \
|
|
|
|
|
--zsh-completion restic.zsh \
|
|
|
|
|
--man .
|
|
|
|
|
installShellCompletion restic.{bash,zsh}
|
|
|
|
|
installManPage *.1
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
|
homepage = "https://restic.net";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
changelog = "https://github.com/restic/restic/blob/${src.rev}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "A backup program that is fast, efficient and secure";
|
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
|
license = licenses.bsd2;
|
2022-06-16 17:23:12 +00:00
|
|
|
|
maintainers = [ maintainers.mbrgm maintainers.dotlambda ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
}
|