2020-10-13 23:50:37 +02:00
|
|
|
|
{ stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, makeWrapper
|
2020-07-05 22:25:06 +02:00
|
|
|
|
, nixosTests, rclone }:
|
2017-03-15 23:44:09 +01:00
|
|
|
|
|
2020-10-13 23:50:37 +02:00
|
|
|
|
buildGoModule rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
|
pname = "restic";
|
2024-02-04 23:43:58 +01:00
|
|
|
|
version = "0.16.4";
|
2017-03-15 23:44:09 +01:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "restic";
|
|
|
|
|
repo = "restic";
|
|
|
|
|
rev = "v${version}";
|
2024-02-04 23:43:58 +01:00
|
|
|
|
hash = "sha256-TSUhrtSgGIPM/cUzA6WDtCpqCyjtnM5BZDhK6udR0Ek=";
|
2017-03-15 23:44:09 +01:00
|
|
|
|
};
|
|
|
|
|
|
2021-02-25 23:00:20 +01:00
|
|
|
|
patches = [
|
|
|
|
|
# The TestRestoreWithPermissionFailure test fails in Nix’s build sandbox
|
|
|
|
|
./0001-Skip-testing-restore-with-permission-failure.patch
|
|
|
|
|
];
|
|
|
|
|
|
2024-02-04 23:43:58 +01:00
|
|
|
|
vendorHash = "sha256-E+Erf8AdlMBdep1g2SpI8JKIdJuKqmyWEUmh8Rs5R/o=";
|
2020-10-13 23:50:37 +02:00
|
|
|
|
|
2020-04-26 10:34:20 +02:00
|
|
|
|
subPackages = [ "cmd/restic" ];
|
|
|
|
|
|
2020-07-05 22:25:06 +02:00
|
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
2020-04-26 10:34:20 +02:00
|
|
|
|
|
2020-02-07 11:39:18 +01:00
|
|
|
|
passthru.tests.restic = nixosTests.restic;
|
|
|
|
|
|
2020-10-13 23:50:37 +02:00
|
|
|
|
postPatch = ''
|
2023-08-01 21:49:04 +02:00
|
|
|
|
rm cmd/restic/cmd_mount_integration_test.go
|
2020-10-13 23:50:37 +02:00
|
|
|
|
'';
|
|
|
|
|
|
2020-07-05 22:25:06 +02:00
|
|
|
|
postInstall = ''
|
|
|
|
|
wrapProgram $out/bin/restic --prefix PATH : '${rclone}/bin'
|
|
|
|
|
'' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
2020-04-28 03:50:57 +02:00
|
|
|
|
$out/bin/restic generate \
|
2020-04-26 10:34:20 +02:00
|
|
|
|
--bash-completion restic.bash \
|
2023-07-05 19:50:22 +02:00
|
|
|
|
--fish-completion restic.fish \
|
2020-04-26 10:34:20 +02:00
|
|
|
|
--zsh-completion restic.zsh \
|
|
|
|
|
--man .
|
2023-07-05 19:50:22 +02:00
|
|
|
|
installShellCompletion restic.{bash,fish,zsh}
|
2020-04-26 10:34:20 +02:00
|
|
|
|
installManPage *.1
|
2017-03-15 23:44:09 +01:00
|
|
|
|
'';
|
|
|
|
|
|
2018-05-21 22:15:33 +02:00
|
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
|
homepage = "https://restic.net";
|
2022-06-05 00:52:35 +02:00
|
|
|
|
changelog = "https://github.com/restic/restic/blob/${src.rev}/CHANGELOG.md";
|
2017-03-15 23:44:09 +01:00
|
|
|
|
description = "A backup program that is fast, efficient and secure";
|
2017-08-03 16:37:04 +02:00
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2017-03-15 23:44:09 +01:00
|
|
|
|
license = licenses.bsd2;
|
2022-06-05 00:52:35 +02:00
|
|
|
|
maintainers = [ maintainers.mbrgm maintainers.dotlambda ];
|
2023-12-12 21:49:17 +01:00
|
|
|
|
mainProgram = "restic";
|
2017-03-15 23:44:09 +01:00
|
|
|
|
};
|
|
|
|
|
}
|