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";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
version = "0.12.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "restic";
|
|
|
|
|
repo = "restic";
|
|
|
|
|
rev = "v${version}";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
sha256 = "07gxf56g45gj2arvdnrr9656i9ykhy1y6k6zdlni1sa3aa2x2bbf";
|
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
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
vendorSha256 = "14z22lmdd681rn61alpqbn3i9fn0kcc74321vjvhz2ix2mch3c1z";
|
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";
|
|
|
|
|
description = "A backup program that is fast, efficient and secure";
|
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
|
license = licenses.bsd2;
|
|
|
|
|
maintainers = [ maintainers.mbrgm ];
|
|
|
|
|
};
|
|
|
|
|
}
|