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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.5 KiB
Nix
Raw Normal View History

{ stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, makeWrapper
2020-07-05 23:25:06 +03:00
, nixosTests, rclone }:
2017-03-16 01:44:09 +03:00
buildGoModule rec {
pname = "restic";
version = "0.15.0";
2017-03-16 01:44:09 +03:00
src = fetchFromGitHub {
owner = "restic";
repo = "restic";
rev = "v${version}";
hash = "sha256-qWVmsW16eQM7d+HoHR2qE7GpcC5HK7TIhhx6J2glKpA=";
2017-03-16 01:44:09 +03:00
};
2021-02-26 01:00:20 +03:00
patches = [
# The TestRestoreWithPermissionFailure test fails in Nixs build sandbox
./0001-Skip-testing-restore-with-permission-failure.patch
];
vendorHash = "sha256-zhLFMvp97mQclaLwH4Hl8jFNMmoYrf8AtVv49RDq7lM=";
subPackages = [ "cmd/restic" ];
2020-07-05 23:25:06 +03:00
nativeBuildInputs = [ installShellFiles makeWrapper ];
2020-02-07 13:39:18 +03:00
passthru.tests.restic = nixosTests.restic;
postPatch = ''
rm cmd/restic/integration_fuse_test.go
'';
2020-07-05 23:25:06 +03: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-16 01:44:09 +03:00
'';
2018-05-21 23:15:33 +03:00
meta = with lib; {
homepage = "https://restic.net";
changelog = "https://github.com/restic/restic/blob/${src.rev}/CHANGELOG.md";
2017-03-16 01:44:09 +03:00
description = "A backup program that is fast, efficient and secure";
2017-08-03 17:37:04 +03:00
platforms = platforms.linux ++ platforms.darwin;
2017-03-16 01:44:09 +03:00
license = licenses.bsd2;
maintainers = [ maintainers.mbrgm maintainers.dotlambda ];
2017-03-16 01:44:09 +03:00
};
}