nixpkgs-suyu/pkgs/tools/backup/restic/default.nix
Bruno Bigras 5a0b1947ed restic: 0.9.6 -> 0.10.0
Co-authored-by: Martin Polden <mpolden@mpolden.no>
Co-authored-by: zowoq <59103226+zowoq@users.noreply.github.com>
2020-10-13 18:55:49 -04:00

45 lines
1.2 KiB
Nix

{ stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, makeWrapper
, nixosTests, rclone }:
buildGoModule rec {
pname = "restic";
version = "0.10.0";
src = fetchFromGitHub {
owner = "restic";
repo = "restic";
rev = "v${version}";
sha256 = "0nrh52cjymzcf093sqqa3kfw2nimnx6qwn8aw0wsci2v2r84yzzx";
};
vendorSha256 = "1pfixq3mbfn12gyablc4g0j8r00md3887q0l8xgxy76z0d8w924s";
subPackages = [ "cmd/restic" ];
nativeBuildInputs = [ installShellFiles makeWrapper ];
passthru.tests.restic = nixosTests.restic;
postPatch = ''
rm cmd/restic/integration_fuse_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 \
--zsh-completion restic.zsh \
--man .
installShellCompletion restic.{bash,zsh}
installManPage *.1
'';
meta = with lib; {
homepage = "https://restic.net";
description = "A backup program that is fast, efficient and secure";
platforms = platforms.linux ++ platforms.darwin;
license = licenses.bsd2;
maintainers = [ maintainers.mbrgm ];
};
}