mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-15 10:12:58 +00:00
353b200c0e
Diff: https://github.com/restic/restic/compare/v0.15.2...v0.16.0 Changelog: https://github.com/restic/restic/blob/v0.16.0/CHANGELOG.md
53 lines
1.5 KiB
Nix
53 lines
1.5 KiB
Nix
{ stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, makeWrapper
|
||
, nixosTests, rclone }:
|
||
|
||
buildGoModule rec {
|
||
pname = "restic";
|
||
version = "0.16.0";
|
||
|
||
src = fetchFromGitHub {
|
||
owner = "restic";
|
||
repo = "restic";
|
||
rev = "v${version}";
|
||
hash = "sha256-kxxQlU3bKBjCb1aEtcLBmcnPg4KFgFlbFhs9MmbAgk8=";
|
||
};
|
||
|
||
patches = [
|
||
# The TestRestoreWithPermissionFailure test fails in Nix’s build sandbox
|
||
./0001-Skip-testing-restore-with-permission-failure.patch
|
||
];
|
||
|
||
vendorHash = "sha256-m5smEyAt9RxgvUf1pZqIhgja2h8MWfEgjJ4jUgrPMPY=";
|
||
|
||
subPackages = [ "cmd/restic" ];
|
||
|
||
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
||
|
||
passthru.tests.restic = nixosTests.restic;
|
||
|
||
postPatch = ''
|
||
rm cmd/restic/cmd_mount_integration_test.go
|
||
'';
|
||
|
||
postInstall = ''
|
||
wrapProgram $out/bin/restic --prefix PATH : '${rclone}/bin'
|
||
'' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
||
$out/bin/restic generate \
|
||
--bash-completion restic.bash \
|
||
--fish-completion restic.fish \
|
||
--zsh-completion restic.zsh \
|
||
--man .
|
||
installShellCompletion restic.{bash,fish,zsh}
|
||
installManPage *.1
|
||
'';
|
||
|
||
meta = with lib; {
|
||
homepage = "https://restic.net";
|
||
changelog = "https://github.com/restic/restic/blob/${src.rev}/CHANGELOG.md";
|
||
description = "A backup program that is fast, efficient and secure";
|
||
platforms = platforms.linux ++ platforms.darwin;
|
||
license = licenses.bsd2;
|
||
maintainers = [ maintainers.mbrgm maintainers.dotlambda ];
|
||
};
|
||
}
|