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-11-16 04:20:00 +00:00
|
|
|
|
version = "0.16.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "restic";
|
|
|
|
|
repo = "restic";
|
|
|
|
|
rev = "v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
|
hash = "sha256-Qrbg8/f1ne+7c+mnUc/8CoZBjiGLohJXnu0cnc0pT4g=";
|
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-11-16 04:20:00 +00:00
|
|
|
|
vendorHash = "sha256-Ctg6bln5kzGs7gDLo9zUpsbSybKOtHFuHvHG3cxCfac=";
|
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 = ''
|
2023-08-04 22:07:22 +00:00
|
|
|
|
rm cmd/restic/cmd_mount_integration_test.go
|
2020-10-19 09:53:12 +00:00
|
|
|
|
'';
|
|
|
|
|
|
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 \
|
2023-07-15 17:15:38 +00:00
|
|
|
|
--fish-completion restic.fish \
|
2020-05-03 17:38:23 +00:00
|
|
|
|
--zsh-completion restic.zsh \
|
|
|
|
|
--man .
|
2023-07-15 17:15:38 +00:00
|
|
|
|
installShellCompletion restic.{bash,fish,zsh}
|
2020-05-03 17:38:23 +00:00
|
|
|
|
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 ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
mainProgram = "restic";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
}
|