nixpkgs/pkgs/tools/backup/restic/default.nix

51 lines
1.4 KiB
Nix
Raw Normal View History

{ stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, makeWrapper
2020-07-05 22:25:06 +02:00
, nixosTests, rclone }:
2017-03-15 23:44:09 +01:00
buildGoModule rec {
pname = "restic";
2021-08-03 20:44:33 +02:00
version = "0.12.1";
2017-03-15 23:44:09 +01:00
src = fetchFromGitHub {
owner = "restic";
repo = "restic";
rev = "v${version}";
2021-08-03 20:44:33 +02:00
sha256 = "19lzccipbpxdkay60zdqfq8dgah0sbxzjcfcx285c28js2zpp85m";
2017-03-15 23:44:09 +01:00
};
2021-02-25 23:00:20 +01:00
patches = [
# The TestRestoreWithPermissionFailure test fails in Nixs build sandbox
./0001-Skip-testing-restore-with-permission-failure.patch
];
2021-08-03 20:44:33 +02:00
vendorSha256 = "0sdswihiy4r3lw9a87xj2qm3nf28cw56yfm56mva6b8lr3vk93l6";
subPackages = [ "cmd/restic" ];
2020-07-05 22:25:06 +02:00
nativeBuildInputs = [ installShellFiles makeWrapper ];
2020-02-07 11:39:18 +01:00
passthru.tests.restic = nixosTests.restic;
postPatch = ''
rm cmd/restic/integration_fuse_test.go
'';
2020-07-05 22:25:06 +02:00
postInstall = ''
wrapProgram $out/bin/restic --prefix PATH : '${rclone}/bin'
'' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
$out/bin/restic generate \
--bash-completion restic.bash \
--zsh-completion restic.zsh \
--man .
installShellCompletion restic.{bash,zsh}
installManPage *.1
2017-03-15 23:44:09 +01:00
'';
2018-05-21 22:15:33 +02:00
meta = with lib; {
homepage = "https://restic.net";
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;
2017-05-29 23:53:49 +02:00
maintainers = [ maintainers.mbrgm ];
2017-03-15 23:44:09 +01:00
};
}